+ Reply to Thread
Results 1 to 2 of 2

Copying a MSAccess file while open

  1. #1
    Registered User
    Join Date
    01-19-2006
    Posts
    35

    Copying a MSAccess file while open

    Hi Guys,
    I am wondering the best way to tackle this. I am copying an access file from one location to another ie.
    FileCopy "P:\DM.mdb", "P:\DMCopy.mdb"
    This works perfectly if the database is closed. If per chance I strike it lucky and someone has it open, then I get an error message.
    So, I am trying to do this
    '--------------------------------------------------------------
    TryAgain:
    On Error GoTo HandlerWaitFiveSecs
    Application.DisplayAlerts = False

    FileCopy "P:\DM.mdb", "P:\DMCopy.mdb"
    On Error GoTo 0

    'Other code here

    HandlerWaitFiveSecs:
    Application.Wait Now + TimeValue("0:00:05")
    GoTo TryAgain
    '--------------------------------------------------------------


    The only trouble now is that it loops back after 5 secs and if the db is still open, I then get the same error message.

    Any ideas?

    Cheers
    Phil Spyve

  2. #2
    Registered User
    Join Date
    08-06-2007
    Posts
    3
    Do you want it to keep looping until the database is closed, and then copy it, and not display the error message each time it loops?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1