TransferDatabase Action

T

taccea

I am looking for some sample VB code that uses the TransferDatabase method
of the DoCmd object, to import tables from a predetermined SQL source into
Access.

Any guidance appreciated

Taccea
 
D

Douglas J. Steele

Here's an example from the Help file:

DoCmd.TransferDatabase acLink, "ODBC Database", _
"ODBC;DSN=DataSource1;UID=User2;PWD=www;LANGUAGE=us_english;" _
& "DATABASE=pubs", acTable, "Authors", "dboAuthors"

It assumes that you've got a DSN named "DataSource1", that you're using a
UserID of User2 with a password of www, and that you want to link to the
Authors table in the pubs database (naming the linked table dboAuthors).

You can replace acLink with acImport to actually import the data.
 
T

taccea

Thanks

Taccea

Douglas J. Steele said:
Here's an example from the Help file:

DoCmd.TransferDatabase acLink, "ODBC Database", _
"ODBC;DSN=DataSource1;UID=User2;PWD=www;LANGUAGE=us_english;" _
& "DATABASE=pubs", acTable, "Authors", "dboAuthors"

It assumes that you've got a DSN named "DataSource1", that you're using a
UserID of User2 with a password of www, and that you want to link to the
Authors table in the pubs database (naming the linked table dboAuthors).

You can replace acLink with acImport to actually import the data.
 
T

taccea

Doug,

I have done the database import and it worked fine
except when I try to index one of the tables that I have brought in, it does
not allow me to, acting like it hold a lock on it. I have verified this
because if I copy the table within access2000 then I can index using the
same ADO code, any ideas why ?


taccea
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top