HELP HELP!! VB 4.0, ACCESS 7.0 and Security (Passwords etc.) 
Author Message
 HELP HELP!! VB 4.0, ACCESS 7.0 and Security (Passwords etc.)

Hello,

I'm having problems accessing my password protected Access databases.
I've tried it in several ways; all with the same disappointing
result...

There are two possibilities to secure a database in Access:
- setting a database password
- using user level security.

I've tried both. After performing the first method and using
OpenDataBase(somepath, false, false, "......") i get the error message
3151 odbc connection failed. I was expecting this since in help on the
opendatabase method, passing parameters in the "..." part is only
allowed for odbc. I still tried since someone suggested this in
another post (follow up on Yao Lin's: VB using Access).

I then reverted to creating a user level secured database. I have the
admin user (part of Admin and User groups) with full access and i have
a "John Doe" user also with full access except for administrative
tasks (part of only the user group). When i try to pass the password
and user name to Access from VB i have tried using
DBEngine.DefaultUser = "____" and DBEngine.DefaultPassword = "____"
and
Set MyWs = DBEngine.CreateWorkspace("name", "user", "password") i get
the following error:
"3028, can't start your application. The system database is missing or
opened exclusively by another user."

I'm not sure I understand error 3028 completely; is VB referring to
the SYSTEM.MDW file here? If not: to what then? The actual database
with data in it? If so, then both remarks in the error statement are
not true!

So as you can see: a lot of messing around, no results :(

If someone has succeeded in accessing a secured Access (appropriate
name ;) database through VB 4.0 32bits, please let me know how this is
done.

Thanks,
Michiel Magne.



Fri, 19 Mar 1999 03:00:00 GMT  
 HELP HELP!! VB 4.0, ACCESS 7.0 and Security (Passwords etc.)

Quote:

>Hello,

>I'm having problems accessing my password protected Access databases.

Not any more. It took some time but i've solved the problem myself.


Sun, 21 Mar 1999 03:00:00 GMT  
 HELP HELP!! VB 4.0, ACCESS 7.0 and Security (Passwords etc.)

Quote:
>I'm having problems accessing my password protected Access databases.
>I've tried it in several ways; all with the same disappointing
>result...

<stuff deleted>

Quote:
>I then reverted to creating a user level secured database. I have the
>admin user (part of Admin and User groups) with full access and i have
>a "John Doe" user also with full access except for administrative
>tasks (part of only the user group). When i try to pass the password
>and user name to Access from VB i have tried using
>DBEngine.DefaultUser = "____" and DBEngine.DefaultPassword = "____"
>and
>Set MyWs = DBEngine.CreateWorkspace("name", "user", "password") i get
>the following error:
>"3028, can't start your application. The system database is missing or
>opened exclusively by another user."
>I'm not sure I understand error 3028 completely; is VB referring to
>the SYSTEM.MDW file here? If not: to what then? The actual database
>with data in it? If so, then both remarks in the error statement are
>not true!

The system database is the SYSTEM.MDW file (or, in Access 2.0, the
SYSTEM.MDA file).  Error 3028 occurs when the engine can't open the file.
As the error message sez, either the file is open exclusively or it's
missing.  Of course it's not open exclusively (unless you're working in a
really weird environment), so the problem is that the engine can't find
it.

And how does the engine know where the file is?  The SystemDbPath line in
the INI file tells it.  What INI file?  *There's* your problem.  VB's
DBEngine object doesn't know the name of the INI file or where to look
for it unless you tell it.

Here's how I do it:

    Dim wsMain as Workspace
    Dim dbMain as Database
    Dim sPathToINIFile as String
    Dim sPathToDatabase as String

    ...

    With DBEngine
        .IniPath = sPathToINIFile
        .DefaultUser = "DefaultUser"          
        .DefaultPassword = "DefaultPassword"
    End With

    Set wsMain = DBEngine.Workspaces(0)
    Set dbMain = wsMain.OpenDatabase(sPathToDatabase, False, False)

I've never tried passing the user/password information to CreateWorkspace,
so I can't tell you if there's anything else that needs to be done for that
to work.  But this works, at least with Access 2.0.

Bob Rossney



Tue, 23 Mar 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HELP: Security: Access 7.0 with VB 4.0

2. VB 4.0 (32-bit) accessing password protected Access 7.0 database

3. VB 4.0 (32-bit) accessing password protected Access 7.0 database

4. Please help in VB 4.0 trying to access MS access 7.0 forms and reports

5. Help. VB(32) and Access 7.0 (Database password)

6. Help with passing parameters with VB 4.0/Access 7.0

7. Help with VB 4.0 and Access 7.0

8. HELP with VB 4.0 Standard / Access 7.0 - BeginTrans / CommitTrans

9. Help: Password on Access 7.0 and VB4

10. VB 4.0 can NOT access Access 7.0 .MDB

11. VB 4.0 16-bit application interfacing with Access 7.0 tables

12. Using Access 7.0 with VB 4.0

 

 
Powered by phpBB® Forum Software