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

Placing Password in TransferDatabase Command?

Status
Not open for further replies.

AndrewCorkery

Technical User
Oct 16, 2002
21
0
0
AU
Hi,

I have a problem with this routine not acknowledging the UID and PASSWORD.

The database runs code automatically after being opened so that users have data updated in the morning. Therefore I need to make sure that the MS Access DB can log on to the Main DB via an ODBC connection to retrive records.

The code I have used is below:

Function importTablesAttache()
On Error GoTo importTablesAttache_Err

DoCmd.SetWarnings False

' Invoice HEADER
DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=00021736;UID=bob;PWD=driver;DBQ=O:\Attache\ATTACHE;CODEPAGE=1252;;TABLE=INVOICE_HEADER", acTable, "INVOICE_HEADER", "INVOICE_HEADER", False

' Sales Reps
DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=00021736;UID=bob;PWD=driver;DBQ=O:\Attache\ATTACHE;CODEPAGE=1252;;TABLE=SALES_REPS", acTable, "SALES_REPS", "SALES_REPS", False

' Invoice Detail
DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=00021736;UID=bob;PWD=driver;DBQ=O:\Attache\ATTACHE;CODEPAGE=1252;;TABLE=INVOICE_DETAIL", acTable, "INVOICE_DETAIL", "INVOICE_DETAIL", False
DoCmd.SetWarnings True


importTablesAttache_Exit:
Exit Function

importTablesAttache_Err:
MsgBox Error$
Resume importTablesAttache_Exit

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top