Supplying a username and password for an ODBC database

M

Martin Tallett

I need to run an Access job overnight which has linked tables via ODBC to an
IBM iSeries DB2 database. The problem arises when the first connection is
made to the iSeries as a popup appears requesting a username and password -
not a good idea in the middle of the night! Therefore I want to supply the
username and password somehow without having to be there in person... I have
tried the following code to refresh the ODBC linked tables and supply the
username and password in the connect string but I get the error message -
"Run-time error 3000: Reserved error (-7778); there is no message for this
error."

Any ideas please?

Public Function ConnectMe() As String
Dim db As DAO.Database
Dim sConnect As String
Set db = CurrentDb
sConnect = "ODBC;Driver={Client Access ODBC Driver
(32-bit)};System=S44436A;Uid=TALLETTM;PWD=MyPassword"
db.TableDefs(6).Connect = sConnect
db.TableDefs(6).RefreshLink
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top