Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export table to another database using TransferDatabase

Status
Not open for further replies.

H1004

MIS
Oct 28, 2003
136
US
I have two databases…One is Personnel_be.mdb from the R drive, and another one Personnel_be.mdb at a Q drive.
This is my command line to export the table tblAssetCheckout from the R drive to the Q drive. So when I ran it, it gave me the following error message:

“You can’t delete the tblAssetCheckout; it is participating in one or more relationship.”

I guess I’m kinda confused in why that is the case when I’m just exporting them and not deleting it. Any suggestion on this is greatly appreciated.

My code from the Personnel.mdb (front end), which has a link to the table from the R drive. This is from onclick of an Update button.

DoCmd.TransferDatabase acExport, "Microsoft Access", _
"Q:\\MRPersonnel_be.mdb", acTable, _
"tblAssetCheckout", "tblAssetCheckout", False
 
H1004,

I believe the problem is when you export an object from one db to another, it creates a new instance of that object. Therefore, when you are exporting it tries to delete the old one thats there but it can because of the relationships defined.

Why don't you use an append query? If you need to delete the information from the table first, use a delete query and then an append query.

HTH

Chris
 
I don't want to append it, I want to replace the tables from the database in the Q drive to the R drive. Should I delete the tables in the Q drive b/4 exporting it..But what about the relationship??
 
Im not really sure you can delete the table because of the relationship. Why do you want to replace the table?

Is there a different structure to the table or is it static?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top