Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a second SECURED database

Status
Not open for further replies.

pouggy

Programmer
Jan 30, 2003
8
GB
I have written two applications which are written in MS Access 97; both of which have full security using different systemdb files.

In order to open the second database it is necessary to stipulate the name and location of the workgroup (systemdb) file that is used with that database, eg

DBEngine.SystemDB = "\full path\xx.mdw"

A new workspace is then created giving the user ID and password, eg

set ws = db.createworkspace("New", "Me", "MyPassword",dbUseJet)

So far so good, but the routine fails as the new workgroup file is ignored.

Using "? DBEngine.SystemDB" in the Immediate window replies with the name of the workgroup file used when the current database was opened, where in fact it should display the new workgroup file "xx.mdw".

All the documentation I have read gives similar examples and all fail to work. This is not confined to a single computer.
 
Don't change using 'DBEngine.SystemDB = "\full path\xx.mdw' but set the new Database object using a "System Database=" in the string.

Use the 'Connect' parameter of the OpenDatabase method.
connect Optional. A Variant (String subtype) that specifies various connection information, including passwords.

?CurrentProject.Connection
Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\LogApps\ComponentsDb\COMPDB2K.MDB;Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database=C:\PROGRA~1\MICROS~2\ACCESS~1\Office\Office\SYSTEM.MDW;Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False
-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top