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??
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??