referencing password protected databases in functions (1 Viewer)

belton

Registered User.
Local time
Today, 11:43
Joined
May 9, 2001
Messages
13
I have a database, where in a form, I can reference a table as follows, and it works.

dim wsp as workspace
dim db as database
dim rec as recordset

Set wsp = DBEngine.Workspaces(0)
Set db = wsp.OpenDatabase("c:dtabase.mdb", , , ";pwd=PASSWORD")
Set rec = db.OpenRecordset("table1", dbOpenTable)


it always fails at the opendatabase part, 3031 not a valid password.

The database is set with this password, the links have been refreshed, and the form which has the same code works fine...


However, this won't work in a function I've created within a module... why??
 

Users who are viewing this thread

Top Bottom