Password on BackEnd

S

sonmic

Hi,

I have set a password on my backend DB.

In my FrontEnd DB I call a table with the following code :
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb()
Set rst = Openseek("Table")
With rst
rst.Index = "ID"
rst.Seek "=", Forms!XXXX!ID

this code calls the following function to connect the table.

Public Function openseek(table) As Recordset
Dim db As Database, tbl As TableDef, dbspad, sourcetabel
Set db = CurrentDb()
dbspad = Mid(db(table).Connect, InStr(1, db(table).Connect, "=") + 1)
If dbspad = "" Then
Set openseek = db.OpenRecordset(table, dbOpenTable)
Exit Function
End If
sourcetabel = db(table).SourceTableName
Set db = DBEngine(0).OpenDatabase(dbspad)
Set openseek = db.OpenRecordset(sourcetabel, dbOpenTable)
End Function

I have already deleted the links and recreated them but I get allways a
run-time error 3055 (Not a valid file name) on the intruction "Set db =
DBEngine(0).OpenDatabase(dbspad)".

What do I wrong?

Tx in advance
 

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