Solved

VB4 can't find Systemdatabase

Posted on 1997-07-25
8
198 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Macro which automatically sends attachment to Outlook 14 69
Using "ScreenUpdating" 6 63
vb6 connector to mongodb 2 81
How to measure sizes and angles in scanned images ? 3 63
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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now