• Check database path (Access 97 SR2)

    Author
    Topic
    #443809

    I need to be able to check that a user is opening the correct database at startup. It seems some users are copying the database to their desktops instead of making a shortcut. To stop them using copies of the db I want to put in a check at startup that checks whether the database path is valid and if not pops up a message and then exits the db. I think it is possible to do this by getting the strCurrentDBPath and matching it to the valid path. My VBA is very weak though and would like some help in creating this. Thanks.

    Viewing 1 reply thread
    Author
    Replies
    • #1071449

      (Edited by HansV to make URL clickable – see Help 19)

      see MSFT KB http://support.microsoft.com/kb/210395%5B/url%5D

      Is the database path hard coded and unchangeable? IF so then put on the ONOPEN event of the main form that opens with the Database more or less the following
      c:mydocsdata.mdb is where you would put your database path

      if CurrentProject.FullName = c:mydocsdata.mdb then
      else
      msgbox “You are using the wrong database”……
      ‘routine to close database
      DoCmd.Quit
      end if

      Hope this helps.

    • #1071457

      Is the database split into a FE (front end) and BE (back end)?

      The accepted way to use a FE is to copy it to each users PC where it is linked to the BE that is situated on a server.

      • #1072219

        That’s probably what should have been done originally. However we now have about a dozen databases that are used by lots of staff and I would have to fix up all of them. Will look to do this for future databases.

    Viewing 1 reply thread
    Reply To: Check database path (Access 97 SR2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: