Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Check database path (Access 97 SR2)

    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.

  2. #2
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Check database path (Access 97 SR2)

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    see MSFT KB http://support.microsoft.com/kb/210395

    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.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Check database path (Access 97 SR2)

    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.

  4. #4
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check database path (Access 97 SR2)

    Thanks - will give that a try.

  5. #5
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check database path (Access 97 SR2)

    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.

Posting Permissions

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