DoCmd.TransferDatabase

mane_uk

Registered User.
Local time
Today, 00:06
Joined
Feb 14, 2011
Messages
45
Hi all,

Please another pair of eyes would be great to spot what I have been doing wrong. Being too long looking at it that can't find what is going wrong.

I need to copy my tables into another database but without the data. I am using:

Code:
DoCmd.TransferDatabase acExport, "Microsoft Access", laptopDBSource, acTable, _
    tblSourceDest, tblSourceDest, True

It is copying but it copies the data of the table even though I am leaving the structure as TRUE!! (btw, I have tried with False as well and it copied the data the same way!!)

Could it be because my tables are linked and not direct in my front end?

Thanks
Mane
 
Hi James,

Tks for the reply but I really can't see where there is the missing comma...

Just in case, based on the link you sent I have tried the following:

Code:
DoCmd.TransferDatabase transfertype:=acExport, databasetype:="Microsoft Access", _
databasename:=laptopDBSource, _
objecttype:=acTable, Source:=tblSourceDest, _
Destination:=tblSourceDest, structureonly:=True

And still copies the data!!!

Any other suggestion please?

Cheers
 
Try
Code:
DoCmd.Transferdatabase acexport,,"Insert path and name of DB here with quotes",acTable,"Insert Source Table Name Here with quotes","Inert Destination Table Name Here With Quotes",-1
 
It comes up with an error (Error 2507 - type isn't an installed databased.).

Tried adding the "Microsoft Access" which was not included in your code but then it copied with all the data instead of only structure!!!

Any other thoughts?
 
MS Access is the default, you don't need to put it in... and True instead of -1 has the same effect? I'm confused now
 
Tried with the True instead of -1 and without the MS Access, same error message 2507...

Could it be anything to do about the tables being linked?
 
not checked it, but what about docmd.copyobject, rather than transferdatabase.
 
By the way, the commas were fine because you had it in the right argument.
Could it be anything to do about the tables being linked?
I believe if you export a linked table all you're doing is exporting the link and not the table so the data will display via the new link. If you want to export the structure only, then export the actual table and not the link.
 

Users who are viewing this thread

Back
Top Bottom