Results 1 to 4 of 4
  1. #1
    Rickyp is offline Novice
    Windows XP Access 2000
    Join Date
    May 2012
    Location
    El Paso, TX
    Posts
    5

    Using VB, how can an open mdb file be copied?

    I have developed a back up system that is opened when my computer is turned on. My Access Back Up program resides on a back up external drive. When the computer is turned on, a Loader.mdb file, placed in the computers Startup folder, opens the Backup.mdb program using the Hidden argument of the shell command. The program is set to back up every 10 minutes using the timer event on the form that contains the programs instructions for backing up. However, if the mdb file that I am trying to back up is open, the FileCopy statement results in error 70 "Permission denied".



    Manually, the subject mdb file can be copied by selecting it then using (ctl-c) to copy it, then the folder where the copy is to be placed is opend. Then it can be pasted using ctl-v and windows (xp) copies the mdb file although it is open as the ldb file is open.

    Is there anyway VB can be used to copy a locked mdb file?

    Thanks for any help you can send my way!

    Rickyp

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I use a vbScript to copy open db, example:
    Const OverwriteExisting = TRUE
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    'following will copy Access file
    objFSO.CopyFile "\\servername\path\filename.accdb", "c:\", OverwriteExisting
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Rickyp is offline Novice
    Windows XP Access 2000
    Join Date
    May 2012
    Location
    El Paso, TX
    Posts
    5
    June7

    Thanks $1,000,000.00 - Worked like A Dream Come true!

    Where & How did you find this information?

    Again A Sincere "Thank You"


    Rickyp

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Don't remember where I got it from, just googled until I hit it.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Copied Database doesn't function
    By larrydwilliams in forum Database Design
    Replies: 9
    Last Post: 02-08-2012, 10:07 AM
  2. Copied report columns, gridlines uneditable
    By hardwood in forum Reports
    Replies: 1
    Last Post: 06-14-2011, 06:22 PM
  3. Replies: 34
    Last Post: 05-19-2011, 06:29 AM
  4. Replies: 1
    Last Post: 09-27-2010, 10:10 AM
  5. Can not open File already in use.
    By Wrangler in forum Access
    Replies: 1
    Last Post: 03-04-2009, 09:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums