Results 1 to 5 of 5
  1. #1
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328

    Copy Open db file

    I found a site that showed a way to make a copy of a file while the file was open. One of several, but this one works. How do I get the expression to save the copied file to the same folder as the original file? I have tried Application.currentproject.path in several combinations, but am missing something.

    This is code that I found and am using, but need to change to save in same folder as current file.

    Dim external_db As Object
    Set external_db = CreateObject("Scripting.FileSystemObject")
    external_db.CopyFile "C:\Users\GG\Documents\TypesExamplesHints\COPYLive DBfile.accdb", "C:\Users\GG\Documents\TypesExamplesHints\COPY _of _COPYLiveDBfile.accdb", True
    Set external_db = Nothing



    Using A2007 and A2003. Any help much appreciated. From various websites, I know that most people consider copying a live file a bad idea. But here, I have a good reason.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Is there a reason that you need to do this isn code, rather than going to the Office Button - Manage and selecting Back Up Database? This saves the backup to the same folder.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    mussy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    10
    Here is my problem. I developed a datase in Access 2010 that was working pretty well. Suddenly my boss whose computer has the 2007 version kept having ERROR 3343 while trying to open the file. Because of the degree of importance of the project and the time limit to deliver, i went back and recreated the work in the 2007 version. She is happy and I am Happy. Now i am facing a tougher challenge whereby the new database on the new 2007 database, altough on the shared drive network, two users are not permitted to access the database simultaneously anymore. Could someone tell please what really happened there and how i can get it resolved? Thanks,

  4. #4
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Yes-If I use a button at all, it would be on a form accompanied by instructions. My users are not Access familiar and just aren't comfortable/able with actions beyond the forms. Is there a way to do this code with application.currentProject.path?

  5. #5
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Somehow-two postings are getting mixed here. In case missed it, here is reply to Missinglinq on reply to "Copy Open db File":

    Yes-If I use a button at all, it would be on a form accompanied by instructions. My users are not Access familiar and just aren't comfortable/able with actions beyond the forms. Is there a way to do this code with application.currentProject.path?

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

Similar Threads

  1. How to copy a file from one folder to another in vba
    By pkstormy in forum Code Repository
    Replies: 2
    Last Post: 09-20-2012, 05:32 PM
  2. Replies: 1
    Last Post: 09-27-2010, 10:10 AM
  3. Copy file to folder
    By tpcervelo in forum Programming
    Replies: 11
    Last Post: 08-31-2010, 10:01 AM
  4. Replies: 1
    Last Post: 05-02-2010, 05:09 PM
  5. Create Hash - Copy File to string
    By andrew_ww in forum Programming
    Replies: 0
    Last Post: 03-20-2010, 02:14 AM

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