
Access DB + VB6 Passwords in Workspace
Back from Pub.
There are 2 levels of security for Access Database.
1. A password that is stored within the database itself and you must
supply in the Connect string (this is DAO only - Haven't figured out
anymore) e.g. "MS Access;PWD=MyPassword". Note the connect is MS
Access with a space between MS and Access. Then a semicolon. Then
PWD=. Then the password NO Quotes. Also the password is case
sensitive.
The connect string must be supplied EVERY time you open the database.
So all your Data Control must have it.
This password is set using ACCESS not VB. There is no way for VB to
read it, or check it is correct before using it. So how and where does
your VB program know what the password is ?? You could hard code it
into the program and hope no-one will open Access and tinker. You
could put it into an INI file but that defeats the object of having a
password.
And there will come a time when someone changes it and slips on a
banana skin and gets concussion, falls out of the 20th storey window,
leaves the company in a huff, or just forgets. Then all chaos breaks
loose and just when they forgot backups and just entered 6 months
information cause the auditors are coming in today. Once the password
has been changed there is no way to change it back if you don't know
it. No administrator override.
So using that password seems impractical to me.
2. The other level is User level security. A list of users, passwords,
and permissions are kept in the System.MDA, MDW, MDB, MDX, what the
heck file. Once you logon and enter your User name and Password you
can access the database. That is if you are using ACCESS program. VB
doesn't give a toss about those permissions and the DBEngine will let
you in regardless, and any other Tish Pot VB program that someone else
hacks up will do the same.
Which to my mind makes a nonsense of security.
And I am not going to all the trouble to set the DBEngine to the
System.MDW, code logon forms, add users, check permissions and hooray
henry with bouncy error trapping when I can build my own simple
encrypted user and password file and do the checking there.
Jeff