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

Help w/ TransferDatabase method...

Status
Not open for further replies.

dBjason

Programmer
Mar 25, 2005
355
US
Hello,

I'm trying to import a table from MS SQL Server to a local Access database file through VBA. The code I have looks like this:

DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=SDSQL2;LANGUAGE=us_english;DATABASE='TimberlineWarehouse';Integrated Security='SSPI';", acTable, "tempAuditFootnote", "tempAuditFootnote"

The problem is at execution I keep getting a "Run-Time error '3151': ODBC--connection to 'SDSQL2' failed."

Now I've checked, SDSQL2 is a valid server name and 'TimberlineWarehouse' is a valid database name. I'm starting to think it might be something to do with the Integrated Security tag, but I'm not sure.

Any Ideas?

Thanks,
Jason
 
I'm not familiar with that method. But since nobody else has responded, have you considered using BCP to dump the data and transfertext to import it?
 
Or an append/make table query based on a passthrough that returns all data from the relevant SQL Server table?

Out of curiousity why are you importing the table to a local Jet table anyway? Are you sure this is necessary?

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top