Password to backend

B

BrunoKP

I have tried this code:
Private Sub Form_Load()
Dim ServerFile As String

ServerFile = "path\MyDB_be.accdb" '(Office 2007)
Set dbsData = DBEngine.OpenDatabase(ServerFile, False, False, ";pwd=be")

End Sub

When trying to select an item from a combox after the form has been loaded
without errors, I get the message: "Password is not valid". ("be" is valid
when opening MyDB_be.accdb manually)
Bruno
 
B

BrunoKP

I have followed the instructions described in your link and I succeeded in
getting the ID no. 29 of the last record. So far so good.

Now I have tried to implement it to my app.:

Private Sub Form_Load()
Dim ServerFile As String
Dim db As DAO.Database
Dim ws As DAO.Workspace
Dim rst As DAO.Recordset

Set ws = DBEngine.Workspaces(0)
ServerFile = "C:\MyPath\My-be.accdb"
Set db = ws.OpenDatabase(ServerFile, False, False, "MS Access;pwd=be")
Set rst = db.OpenRecordset("tblPerson", dbOpenDynaset)
rst.Close
db.Close
End Sub

Unfortunately I still get the error message "Password is not valid". It
seams to me that the errormessage is generated when I try to open the
combobox which is loaded by a "DLookup" in the table "tblPerson". There is no
error message when I open the start-form.
The form I load is my start-form. I'm in doubt if this is right position to
connect to the "be", and I would like to connect to all the tables in the
"be".

Another point is that MS writes that I must refere to the "Microsoft DAO 3.6
Object Library". This is in conflict the default reference "Microsoft 12.0
Access database engine Object ", so I had to leave it. (remember that I have
Office 2007, the instructions are for (.mdb))

Thanks in advance.

JimBurke via AccessMonster.com" skrev:
 

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