Hi,
i have an access 2003 database with some tables. i'm trying to get a list of tables in the database. the code i'm using is:
however, i'm getting the error
record(s) cannot be read; no read permission on 'MsysObjects'
when i run my script with access 2000, it works ok, but not with access 2003
any help is appreciated.
i have an access 2003 database with some tables. i'm trying to get a list of tables in the database. the code i'm using is:
Code:
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
dbfile = "c:\a\fleet\fleet\fleet2.mdb"
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & dbfile & "; user id=Admin"
commandstring = "SELECT MSysObjects.Name FROM MsysObjects WHERE " & _
"(Left$([Name],1)<>" & chr(39) & "~" & chr(39) & ") " & _
"AND (Left$([Name],4) <> " & chr(39) & "Msys" & chr(39) & ") " & _
"AND (MSysObjects.Type)=1 ORDER BY MSysObjects.Name;"
msgbox commandstring
objRecordSet.Open commandstring, objConnection, adOpenStatic, adLockOptimistic
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
strText = objRecordset.Fields.Item("name")
msg = msg & strText & vbcrlf
objRecordSet.MoveNext
Loop
msgbox msg
record(s) cannot be read; no read permission on 'MsysObjects'
when i run my script with access 2000, it works ok, but not with access 2003
any help is appreciated.