Results 1 to 5 of 5
  1. #1
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299

    Copy Table from Back End to Back End for Back Up Purposes

    After Googling around, I'm stumped. I have some code that will copy my linked BE table with a button from the FE, but it is pasting it in the BE as a linked table. I want to create a back up of the table with a date stamp before importing updated data in the case the data is corrupt/inaccurate/etc. My code is below. Thanks in advance.

    Code:
    DoCmd.CopyObject "NetworkPathtoBE\BE.accdb", Format(Date, "yyyymmdd") & "-Documents", acTable, "Documents"


  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Why not copy the entire backend file?
    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
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    I thought about that, but the back end is 30 MB, and our network here is slower than a car out of gas.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    How slow? My BE is 134+mb and takes about 30 seconds to copy from one server folder to another server folder.

    You are running that code in the FE? If so, then it is understandable that the link is copied because that is what is in the FE.

    To copy table in the BE would have to specify path and db name in the sourceobjectname argument but I don't think that is allowed in the CopyObject method.

    Might have better luck with SELECT INTO sql. Example:

    strDestination = "NetworkPathtoBE\BE.accdb"
    CurrentDb.Execute "SELECT * INTO [" & Format(Date, "yyyymmdd") & "-Documents" & "] IN '" & strDestination & "' FROM Documents;"
    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.

  5. #5
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    I went ahead and tested it, and it didn't take as long as I was expecting to copy the whole BE. Besides speed, my other concern was trying to copy it while others have it open since I have a few different users accessing the same BE through a few different FE, but I found the post you replied to a few weeks back about how to copy an open BE and plugged the code in.

    Thanks for your help!

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

Similar Threads

  1. I'm back!
    By evander in forum General Chat
    Replies: 3
    Last Post: 02-27-2013, 08:29 PM
  2. Replies: 8
    Last Post: 04-26-2012, 10:13 AM
  3. Linking Combobox back to table
    By jlclark4 in forum Forms
    Replies: 52
    Last Post: 12-31-2010, 03:18 PM
  4. Replies: 1
    Last Post: 02-05-2009, 04:53 PM
  5. Copy or Back-up of DB Switchboard not working??
    By techexpressinc in forum Import/Export Data
    Replies: 1
    Last Post: 12-30-2008, 11:49 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