Link to home
Start Free TrialLog in
Avatar of micha71
micha71

asked on

VB4 can't find Systemdatabase

We want to use the security of MSAccess from a
VB application.
We are  doing the following

1.We enabled the security of MSAccess
2. Set path to Systemdatabase in INI-Files
Set SystemDB=C:\Access\system.mda
(under [OPTION])
in vb.ini; .ini; win.ini; msacc20.ini
3. following as code :
dim gws as workspace
Set DBEngine=Nothing
Set DBEngine.IniPath=C:\Windows\.ini
Set DBEngine.UserID="Admin"
Set DBEngine.Password=password     equal as in MSAccess security
Set gws=DBEngine.Workspaces(0)

4. Error Message
we get an error with following message
"Can't start. The system database(typically SYSTEM.MDA) is missing or opened exclusivly by another user."

But we do have SYSTEM.MDA in c:\access

Thanks for any help.
Avatar of ESI
ESI

Don't u need to make a CreateWorkSpace & then an Workspaces.Append, instead of using the default workspace #0 ?
If u want use the default workspace #0, use DBEngine.DefaultUser & DBEngine.DefaultPassword then !
but I think the best solution is to create a new workspace & append it to the dbengine workspaces collection.
Look in the help under CreateWorkspace.
Hope it helps !
Avatar of micha71

ASKER

Edited text of question
Try creating an INI called with the same name as your executable and putting the [Options] & SystemDB=C:\Access\system.mda  lines in there.

If your EXE name is TEST.EXE, use the INI TEST.INI

I think IniPath Is used for Jet 3.0 & greater where the Options  are stored in the Registry.

Default for Access 2.0 /Jet 2.0 & 2.5 is to look in the exe for the [Options] block with SystemDB=C:\Access\system.mda

Hope this helps,

Chris

Avatar of micha71

ASKER

Adjusted points to 150
I believe you may be using VB 4 Pro 32 bit, maybe VB 5.   If that is the case the IniPath of the DBEngine is not used as it is in the 16 bit version.    In the 32 bit version the property is SystemDB.  In place of DBEngine.Inipath = "Path to ini file" use the following.

DBEngine.SystemDB = "Path to System.mda" or System.mdw.  

Search Help on SystemDB and that should clarify it further.
Avatar of micha71

ASKER

I use VB 4 16 bit.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of haas090897
haas090897

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of micha71

ASKER

Dear ChrisLewis

I do have a application INI with this line.
I had wrote this in my question(after vb.ini) but it wasn't
shown.

Thanks.