Sample Function to Provide Password - Access 2003?

R

ruffed grouse

We have been using the code in the following article to
establish a connection with our AS400 prior to running
various queries against the 400's tables:

http://support.microsoft.com/default.aspx?scid=kb;en-
us;109829&Product=acc

Here's the code it suggests:

Function Establish_Connection ()
Dim db As Database, dbcurr As Database
Dim ds As Recordset
Set dbcurr = CurrentDB()
Set db = OpenDatabase("", False, False, _
"ODBC;DSN=<data source name>;" &
_
"UID=<UserID>;PWD=<Password>;DATABASE=" &
_
"<database name>;")
Set ds = db.OpenRecordset("<any table existing
in the
database defined by DATABASE above>")
End Function


We've recently upgraded our PC's and are now using Access
2003 (previously we used XP), and now this code doesn't
seem to work anymore...we can't seem to bypass the login
prompt in client access.

Any ideas on how to get this to work in the newer version
of Access?
 

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