MSysObjects permissions

  • Thread starter Thread starter benatom
  • Start date Start date
B

benatom

I am attempting to get a list of table names from an Access database.

If I try to open this recordset:

Set db = OpenDatabase("C:\DataFolder\Data.mdb)
Set rs1 = db.OpenRecordset("Select Name, Type From MSysObjects WHERE
Type = 1 AND FLAGS = 0 ORDER BY Name;")

I get this message:

Record(s) cannot be read; no read permission on 'MSysObjects'

Can I do what I'm trying to do, or is there a better way?
 
Well, this may be a typo, but you don't have a closing quote in the
path/filename string:
Set db = OpenDatabase("C:\DataFolder\Data.mdb)

Assuming it's a typo, is C:\DataFolder\Data.mdb the current database? And
if so, could you use CurrentDb?
Set db= CurrentDb

If C:\DataFolder\Data.mdb is an external database, could you link its
MSysObject (calling MSysObjectsRemote) table and use CurrentDb and use
MSysObjectsRemote in the query?

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Back
Top