Solved

VB4 can't find Systemdatabase

Posted on 1997-07-25
8
199 Views
Last Modified: 2012-08-14
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.
0
Comment
Question by:micha71
8 Comments
 
LVL 3

Expert Comment

by:ESI
ID: 1428880
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 !
0
 

Author Comment

by:micha71
ID: 1428881
Edited text of question
0
 
LVL 3

Expert Comment

by:ChrisLewis
ID: 1428882
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

0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:micha71
ID: 1428884
Adjusted points to 150
0
 

Expert Comment

by:staylor081797
ID: 1428885
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.
0
 

Author Comment

by:micha71
ID: 1428886
I use VB 4 16 bit.

Thanks.
0
 
LVL 1

Accepted Solution

by:
haas090897 earned 150 total points
ID: 1428887
I just read that SystemDB only applies to vb 4 32 bit.
In 16 bit you need to use the Dbengine.inipath property or put the system.mdw file in current directory and use SetDefaultWorkspace or create a new Workspace.

Try to use GetSetting to retrieve the path to System.mdw
Syntax
GetSetting(appname, section, key,[default])

0
 

Author Comment

by:micha71
ID: 1428883
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.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question