
vb6 & passworded access 97 dataase(s) [please help]
I am writing a program that requires the ability to open a passworded database. I would like to be able to have the database passworded and have the user enter a username and password to "logon" to the database. I have tried several ways of doing this and each time I either get a message saying; that the "system.mdw file is missing or open exclusively by another program" or I get a message saying that the password is incorrect, when I know the one I supplied in code is the right password.
There are two databases, one that supplies support data and one that records the actual outcome of the users input. It is the once that records the users output that needs to have the security.
At the moment only the database is passworded and the password is temporarily "tyler"
(This program/database is for a funeral home, thus the references to "cremation" and such)
Here is what my Form1_load sub routine looks like as far as the initialization of the db goes:
-----------8<----------------
Static Sub Form_Load()
'cremation info database
Set wrkjet_CRD = CreateWorkspace("JetWorkspace", "Admin", "", dbUseJet)
'cremation info database
Set DB_CRD = wrkjet_CRD.OpenDatabase(App.Path & "\Records.mdb", False)
'cremation info recordset
Set RS_CRI = DB_CRD.OpenRecordset("cremation info", dbOpenDynaset)
'DBEngine.DefaultPassword = "fun"
'support database
Set wrkJet_SD = CreateWorkspace("JetWorkspace", "Admin", "", dbUseJet)
'*****this is where it tells me the system.mdw file is missing or in exclusive use by another program.
'support database
Set DB_SD = OpenDatabase(App.Path & "\Support Data.mdb", False, , pwd = "tyler")
'wrkJet_SD.
'support data
Set RS_CD = DB_SD.OpenRecordset("client data", dbOpenDynaset)
Set RS_MED = DB_SD.OpenRecordset("McgEmployee", dbOpenDynaset)
Set RS_HPM = DB_SD.OpenRecordset("HPMcEmployee", dbOpenDynaset)
---------------8<---------------------
If I remove all passwords, and also all password related code the database is open without any problems.
Could you possibly, please; show me how to access a database that is both password protected and has user login protection, it would be very much appreciated.
Thank-you so much for your time!
--
Tyler M. Schwerdfeger