Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB4 can't find Systemdatabase

Posted on 1997-07-25
8
Medium Priority
?
212 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 300 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

927 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