DAO Check If Database Has Password

D

David

I'm writing some VB6 code against an Acess97 Database.

What I want to do is check and see if the database has a password.
If not, allow user to proceed, otherwise prompt for user name and password.

Using DAO how do you check for an Access Password to see if one exists on
the DB?
 
A

Arvin Meyer [MVP]

One would have to open the database to you check for the existence of the
password. Instead do what I do with most error handling and that is when you
have a problem similar to this you just go ahead and try and open it and you
will get an error if there is a password and then you can just go ahead and
deal with the error. Actually, if you are in the correct workgroup the
username/password prompt dialog will appear. Now if you are not in the
correct workgroup, you will not be able to open it anyway. Reading the
registry may be able to tell you which workgroup you are currently in, but
it will not be able to tell you if it's the correct workgroup for that
application.
 
D

David

Thanks Mr. Meyer:

Was hoping there was a clean way other than error trapping.

Have a happy holiday
David
 

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