AndrewCorkery
Technical User
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
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