Opening access database with a password

Why won't the following code work in VB4 to open a database
thru MSoffice 97 with the password aaa?

Dim MyDB as database
Set MyDb = OpenDatabase("c:\user.mdb" , , , "UID=admin;PWD=aaa")
Who is Participating?
DalinConnect With a Mentor Commented:

MyPwd = "WhatEver"

Set MyDb = OpenDatabase("c:\user.mdb",False,False,";Pwd=" & mypwd)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.