Solved

Backup two tables from a network access db to a local db copy

Posted on 2012-03-29
7
358 Views
Last Modified: 2012-04-02
I have an access database on a network that I need to copy 2 tables (say table1, table2) to local copy of the exact database.  We need this as the network goes down frequently and work halts.  I want a user to be able to click a button on a form and have them copy the updated network database tables to the older outdated tables on a local computer.  Any suggestions?

thanks
jb
0
Comment
Question by:BOULMAN
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 500 total points
ID: 37785795
On the button's OnClick event you can put:

DoCmd.TransferDatabase acExport, "Microsoft Access", _
    "C:\PathAndNameOfDatabaseToExportTo.mdb", acTable, "NameOfTableToBeExported", _
    "NameOfTableInDestination"

In your case the names of the source and destination tables will probably be the same.  Do this for each table you want to export.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 37786623
Check out my article on temporary tables.

updatetemptable "LocalTableName", "linkedTableName", True, 0
0
 

Author Comment

by:BOULMAN
ID: 37786629
The above code looks like it will work fine.  Will this overwrite the "old" table info each time I use this?  I won't be able to test that until monday.
thanks
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 37786698
My UpdateTempTable function does, with the other, you will first need to test to see whether the table already exists.  And if it does, delete before running the transferdatabase method.

My UpdateTempTable function also will let you save the new table to a temporary database on the same path as your application, and will automatically link the table from that temporary database to your application, which will avoid some of the bloating issues associated with temporary tables.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37787321
Just a note, ...any system like this is inherently susceptible to failures.
I mean if: "the network goes down frequently and work halts"...

...Then whats to say that the network won't go down in the middle of your"Copy" operation.
Then what?!?!
Half the data is copied, and you loose the original?

You need "Rock Solid" error handling and an "Iron-Clad" "Rollback" system.
(remname the static tables, Import the new tables, verify the copy, delete the originals)
In case of a failure in the middle of the "Copy" operation, your system must be able to delete the incomplete copied table, then restore/rename the original table...
Do you have something like this in place?

It's a shame to have to go through all of this trouble for a "iff-y" network that can't fulfill one of the most basic requirements of a network...
;-)

The same time and energy might be better spent beefing up the network...

;-)

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37787327
...I see that fyed has already touched on this...

Please continue on with the previous experts...

;-)

Jeff
0
 

Author Closing Comment

by:BOULMAN
ID: 37799304
Sorry for the delayed response. But IrogSinta's code works as needed.

thanks
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now