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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer table from dbf to access

Status
Not open for further replies.

CPUburn

Programmer
Jan 18, 2001
146
BE
hi,

I want to transfer a table from a .dbf file to an access database, though not the database in which the code is executed. with the transferdatabase command i know i can import the dbf tables without problems, but i want a direct import into another database.

any suggestions?

thx
 
Hmmmm! Not sure you can do this without the code being in one of the two databases, i.e. the source db or the destination db. TransferDatabase take acExport or acImport as parameters and this implies that you can only export from the database in which the code is running or import into the db in which the code is running.

If there is a way of doing what you are looking for, I'd love to hear of it. Have fun! :eek:)

Alex Middleton
 
This would require some work, but, how about if you import the table into the current db. Using code, create a new table in the target db. Transfer the data to the target table and then delete the imported table.

This is definitely the ugly way, but I cannot think of a clean/easy way to do this.

Hopefully, someone with a better idea will come along. Good Luck.
 
You have a couple of options.

1) You can attach the dbf file and the Access table to your current database and then use a macro to run a series of queries to populate your target.

2) You can attach the dbase table and run a make table query. When you select "Make Table Query" from the query designer, it gives you the option to create the table in another database.

3) You can use ADO code, which allows you to open pipes to all these different sources and pass the data around any way you like.

Kirk

 
hi,

thx guys for all these options,

for the moment we already have the first solution, but the problem is, our clients work in an mde-environment, and after multiple imports and deletions, the db might get to grow.
linking the dbf is not an option either, cause these are files from another program in which the client might still be working in at the moment of transfer.

grtz

CPUburn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top