VB4 - MSaccess security 
Author Message
 VB4 - MSaccess security

I am having a problem trying to use a secured access vers. 2 database.  I have created a
system.mda
and even renamed it to system.mdw, as per the documentation.
I can select the system database and open the database mrp_vb.mda in access and use the security
functions
without problems, however when I try to use the following code in VB4,  I always get the error
code 3028
"Can't find the system.mda or it is opened by another user"

Any help with this problem would be gratefully received..

____________________________________________________________________________

Private Sub Form_Load()

    Dim suser As String
    Dim spw As String
    Dim specialWS As Workspace
    Dim sNewUser As String
    Dim sNewPw As String

    sNewUser = "Bob"
    sNewPw = "letmein"
    suser = DBEngine.Workspaces(0).UserName
    DBEngine.IniPath = "C:\windows\pmtest.ini"
    Set specialWS = DBEngine.CreateWorkspace("special", suser, spw)
   Set Newworkspace = DBEngine.CreateWorkspace("Newworkspace", sNewUser, sNewPw) **** Err 3028
End Sub

___________________________________________________________________________

C:\windows\pmtest.ini

[options]
SystemDB=C:\applicat\pmtest\system.mdw

[pmtest]
LoadSystemDB=Yes

____________________________________________________________________________



Tue, 27 Oct 1998 03:00:00 GMT  
 VB4 - MSaccess security

Quote:

>    sNewUser = "Bob"
>    sNewPw = "letmein"
>    suser = DBEngine.Workspaces(0).UserName
>    DBEngine.IniPath = "C:\windows\pmtest.ini"
>    Set specialWS = DBEngine.CreateWorkspace("special", suser, spw)
>   Set Newworkspace = DBEngine.CreateWorkspace("Newworkspace", sNewUser, sNewPw) **** Err 3028

You didn't indicate if you're using VB4 16-bit or 32-bit, but
from the code I'll guess you're using 16-bit. Anyway, the first
thing is your using the DBEngine object *before* setting the
IniPath property. You need to set the .IniPath property first
before making any reference to any DAO objects or the DBEngine
will be initialized in its default configuration. Also, you're
reading the UserName property without having established a
workspace or setting the UserName property.

FYI, the .IniPath property is not used to indicate the system
database with 32-bit VB4. You need to set the SystemDB property
of the DBEngine object.

HTH,

Joe

Never underestimate the power of a WAG.



Sun, 01 Nov 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. security MSAccess 2.0 database

2. MSAccess/VB4

3. REQ: HOW TO CALL A MSACCESS REPORT FROM VB4

4. Strange MSAccess behaviour with VB4

5. Ole File Saving into Msaccess using VB4.0

6. REQ: HOW TO CALL A MSACCESS REPORT FROM VB4

7. Running report from VB4 with password protected MSAccess database

8. Error 3186, Msaccess VB4 16 Bit

9. Access 97 security and VB4/5?

10. VB4/MSARN200 security issue

11. Can VB4 use ACCESS97 database with JET 3.5 security

12. Security in VB4

 

 
Powered by phpBB® Forum Software