TransferDatabase Action

  • Thread starter Thread starter taccea
  • Start date Start date
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
 
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.
 
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.
 
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
 
Back
Top