
MFC-DAO & Dealing with passwords
Hi Thomas,
Quote:
> Has anyone here ever successfully protected a database with a password
> while using DAO???
> In the DAO documentation there is a method described, but when I follow
> these rules, I get an exception that tells me the system.mdw file is
> missing (although I do have one, but the End-user definively will not
> always have it).
This error usually pops up because your using (trying) a system.mdb that is
not in the same location as the registry key (DAO 3.x) or ini (DAO 2.5).
When implementing this type of security you need to create your own
workspace object and call the SetIniPath method. If you look at the
registry location HKLM/SOFTWARE/Microsoft/Jet you'll see how it needs to be
setup. And the documentation also says that you can append your workspace
to the DAO engines workspace collection, I've never been able to do that
without the "missing .mdb" message. Especially if the default "Admin" user
is removed or denied access.
Just a note: If you implement this type of security on your database and
do not provide a system.mdb for the database the end user will not be able
to access it. So you need to distribute this file as well, or provide the
user with the ability to create the file and/or users.
HTH
--
===================
Frank Hickman
Computers Plus
===================