Working with protected Access DB and non-protected DB in the same application

Working with protected Access DB and non-protected DB in the same application

Post by Arne J. Boye-M?lle » Sat, 22 Jun 2002 02:08:41

Hi people.

I need to work with both a protected and a non-protected Access database at
the same time.  The latter I create on the fly.

I've created an Access workgroup file that is needed to open my protected
I open it like this:
  Dim MyDB As Database
  DBEngine.SystemDB = App.Path & "\myworkgroupfile.MDW"
  DBEngine.DefaultUser = "myadminlogin"
  DBEngine.DefaultPassword = "secretpassword"

 Set MyDB = DBEngine.OpenDatabase(sPath,,

No problem.  Nobody but my programme can get access.

Whilst running my programme I need to create a new database that has no
protection, i.e. is completely open.  I create a couple of tables with
corresponding fields and properties and load a few thousand records.

  This time I use this:
  Dim MyOpenDB As Database
  Dim ws As DAO.Workspace
  DBEngine.SystemDB = ""
  DBEngine.DefaultUser = "admin"
  DBEngine.DefaultPassword = ""
  Set ws = DBEngine.Workspaces(0)
  Set MyOpenDB = ws.CreateDatabase(sFileName, dbLangGeneral)

Now I then try to open the database with the MS-Access and I receive the
following two errors:
1) Record(s) cannot be read;no read permission on 'MSysObjects'
followed by
2) Record(s) cannot be read;no read permission on 'MSysACEs'

After these two errors I experience no further erros.  I can open and work
with the tables without problems.

What am I missing/doing wrong?  Any help much appreciated.

Yours Sincerely,
Arne J. Boye-M?ller


1. Accessing password protected Access db

1) Do not post such large images as attached files. There is no need for
that. You can post only the image of the window with the error, not your
whole desktop. And even better, you can post the error message in plain text
without images.

2) The error is not caused by passwords, since you are connected. As the
message says, it is caused because the connected user has not read
permission on that object. You can adjust the permissions using Access in
the Tools \ Security \ User and Group Permissions menu (or something like
that, I am using the Spanish version). You select the user or group, select
the object 'Container' and check the checkbox Read Data.

Best regards,

Carlos J. Quintero

MZ-Tools 3.0 (New version) freeware 'all-in-one' Add-In for VB6 and VBA:
Code Templates, Detect dead code, Favorite Procedures, Favorite Projects,
External Utilities, XML Documentation,  Private Clipboards, Select Case
Assistant, Sort Procedures, Collapse Projects, Split/Combine Lines, Open
Folder of File, Edit File As Text, MsgBox Assistant, Connect String
Assistant and many more features:

2. Class and Sub Class ?

3. Accessing a Password Protected Access DB

4. NY-NEW YORK-87181--ORACLE-SYBASE-Windows NT-MS SQL Server-Visual Basic-MS Office

5. how do i access a password protected MS-ACCESS db without the password

6. Delete question

7. Question - Making Access DB pw protected Then Accessing that pw protected DB from code - How?

8. StarSQL record locking

9. Insert Into Another DB Query does not work for password protected databases

10. Repair encrypted password protected access DB from VB program

11. Protect an Access 2000 DB

12. How to open a password protected db (access)

13. Opening a pwd-protected Access db