If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > TransferDatabase doesn't work properly

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-26-10, 23:20
realspido realspido is offline
Registered User
 
Join Date: Apr 2009
Posts: 8
TransferDatabase doesn't work properly

Hi again,
ok, here's one for you: I can't get this line of code to work correctly:

Code:
DoCmd.TransferDatabase acExport, "Microsoft Access", strDbPath, acTable, strFrom, strTo, True
it simply doesn't do anything. However, if I tell it to export not only structure, but also the data (change last variable to False), it works!
Question is, why can't I export empty table to get it's structure only?

FYI, the target db is locted on the same hard drive and I'm positive that it's correct path and file name bacause it works in other instance.
I currently stuck with importing the whole thing, but if the source table is very large, it takes very long time to transfer lots of data that I don't need anyway, so I delete it in next line using:
DoCmd****nSQL "DELETE * FROM [" & strTo & "]"
which also takes time.

Any help much appreciated.
Cheers!
Reply With Quote
  #2 (permalink)  
Old 08-27-10, 13:53
HiTechCoach HiTechCoach is offline
Registered User
 
Join Date: May 2010
Posts: 600
Just a thought on a way to make it better:

1) run a make table that select no records from the original table into a temporary table name. This will make a blank tbale with the structure in the local database.

2) export this blank temporary table giving it the correct name ion the destination database.
__________________
Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
Microsoft MVP - Access Expert
BPM/Accounting Systems/Inventory Control/CRM
Programming: Nine different ways to do it right, a thousand ways to do it wrong.
Binary--it's as easy as 1-10-11
Reply With Quote
  #3 (permalink)  
Old 09-01-10, 17:02
Sam Landy Sam Landy is offline
Registered User
 
Join Date: May 2004
Location: New York State
Posts: 931
You might want to try the DoCmd.OutputTo method. I'm not sure whether it works on structure only requirement.

SL
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On