Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Location
    UK
    Posts
    82

    Unanswered: prevent moving a db

    Is there a way to prevent users from copying a db and using that instead of the correct app.

    for example

    a = current db location
    if b < or > a then quit

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    You're logic sounds good to me

    But to flesh it out a little more, if you have a form that is loaded on start up, on the On Open event (I would do), do something like (*untested*)...
    Code:
    Dim strCurrentPath as string, strRightPath as string
    strCurrentPath = Application.CurrentProject.Path
    strRightPath = "c:\your path\yourdB.mdb"
    if strCurrentPath <> strRightPath then
         msgbox "Invalid copy of the database.  You sneaky " & _
                        "little chisel monkey", vbcritical, "Illegal Usage!"
         docmd.quit
    end if
    Just be cautious if you or the admin ever want to change the location.

    Admittedly, this is violating one of the norms of dB design (never store data in code). So we'll see if anyone has a better idea.
    Me.Geek = True

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    various thngs you can do
    1) use the OS security settings to hide and restrict access to those users who have permissions to use it. I forget how we dod it a while back but we set upt he network permissions so that the mdb file was not visible to authorised users if they tried to find it using explorer or something similar, it only appeared when they went through the correct shortcut on their desktop.

    2) you could put some checks int he applciation to make sure that the app resides int he corrct directory.. as part ofthe current app properties Im sure you can examine the current path to the mdb/mde

    3) put some code on start up that always relinks to the central data on the server

    4) put some code int he desktop shortcut which always seeks to download the current version of the db, that way round you know that despite what the user tries to do they will have to use th ecurrent version of the app.

    5) perhaps most importantly make it part if your it policiy that your users don't tinker, to me its an isntant discplinary if they seek to dick about with a live app. its fine if its their app, but it shouldn't be allowed if on a shared live app. similarly its a disciplinary if they leave their app/terminal logged on when they are having an out of office experience.. no excuses instant formal warning.. we've issued a formal warning before now to a PLC's main board FD, who left his terminal connected when he left his office, granted we couldn't give him a disciplinary, but we did threaten loss of computer facilities.. which seemed to cure his maverick ways.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Feb 2007
    Posts
    348
    Quote Originally Posted by nckdryr
    Code:
    "little chisel monkey", vbcritical, "Illegal Usage!"
         docmd.quit
    *snicker*. I may write that into all my apps on load, just because.

  5. #5
    Join Date
    May 2005
    Posts
    1,191
    Once in a while you have to throw those "super" users a curve ball
    Me.Geek = True

  6. #6
    Join Date
    Mar 2004
    Location
    UK
    Posts
    82

    Wink Just the job

    Thanks guys

    i did tinker with the windows user accounts before but when the file was hidden and the short cut shared to all users the app wouldn't open.


    on balance i'll prpbably go with the start up form code method

    cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •