A database password problem

A database password problem

Post by David M. Scot » Mon, 02 Feb 1998 04:00:00



What code is necessary to open an Access 97 db with a password through
VB5?    I scoured messages from various groups, and ones I found either
had too little info to be useful or were just wrong.  I use NT4
workstation and VB5 Pro.  The Access db is protected by a simple
password.  I used this command:

Set wrkSpc = CreateWorkSpace( "", "admin", "password", dbUseJet )

I got a MsgBox saying "Run time error '3028' - Can't start your
application.  The workgroup information file is missing or is opened
exclusively by another user."  This is not on a network, and no other
apps are running.

I would really like to know the right way to do this; does anyone have
working source code for this situation?   Thanks, DS

 
 
 

A database password problem

Post by John Gos » Tue, 03 Feb 1998 04:00:00


Access security is controled by a file called "system.mdw".  You set the
file by using the Access workgroup administrator.  From then on, if security
is set up correctly, you must use that specific system.mdw when accessing
the database.  I think you need to set the system.mdw prior to creating your
workspace.  Use the following:

DBEngine.SystemDB = "\\some server\your path goes here\system.mdw"

John Gose


>What code is necessary to open an Access 97 db with a password through
>VB5?    I scoured messages from various groups, and ones I found either
>had too little info to be useful or were just wrong.  I use NT4
>workstation and VB5 Pro.  The Access db is protected by a simple
>password.  I used this command:

>Set wrkSpc = CreateWorkSpace( "", "admin", "password", dbUseJet )

>I got a MsgBox saying "Run time error '3028' - Can't start your
>application.  The workgroup information file is missing or is opened
>exclusively by another user."  This is not on a network, and no other
>apps are running.

>I would really like to know the right way to do this; does anyone have
>working source code for this situation?   Thanks, DS