A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

MSysObjects permissions



 
 
Thread Tools Display Modes
  #1  
Old June 10th, 2009, 08:25 PM posted to microsoft.public.access
[email protected]
external usenet poster
 
Posts: 15
Default MSysObjects permissions

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?

  #2  
Old June 10th, 2009, 08:58 PM posted to microsoft.public.access
Roger Carlson
external usenet poster
 
Posts: 824
Default MSysObjects permissions

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/...UBED1=ACCESS-L


wrote in message
...
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?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:01 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.