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

transferdatabase command with password protected database

Status
Not open for further replies.

impulse24

IS-IT--Management
Jul 13, 2001
167
US
Hi,

I have searched everywhere for help with this and can't find any straight answers.

How do you input the password into VBA code, when using the DoCmd.Transferdatabase method. I know how to set the password when opening the database, and I know how to input the password if I am setting up an ODBC connection. But in this case I have multiple databases(more than 20), and I want to import the tables from the multiple databases into a single database, so setting up a straight one time DSN with the path to the database wouldnt work, as I have a variable holding the database names, and want to loop through each one, and import.Any help would be greatly appreciated.
 
Try this

Dim dbsPassword As Database
Set dbsPassword = OpenDatabase(YourDataBaseName, False, False, "; pwd=YouDBPassWord")

........do your importing/exporting

dbsPassword.Close
 
thanks..but i found the easier method just to set an odbc connection string in the transferdatabase command and use the password there..works great
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top