Link to home
Start Free TrialLog in
Avatar of Aiysha
AiyshaFlag for United States of America

asked on

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

I get error 'Record(s) cannot be read; no read permission on 'msysobjects' 'on the line given below.. any ideas how to resolve this error


Dim TableName(100)
Dim DatabasePath(100)
Dim NO_of_Records

Dim conn
Dim rec
Dim j

j = 1

Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\AiyshaTest\AiyshaTest.mdb;Persist Security Info=False"
esql = "SELECT Name, Database, Connect FROM msysobjects WHERE (Type=1 Or Type=4 Or Type=6) And Name Not Like ""MSys*"" ORDER BY Name"
MsgBox esql
rec.Open (esql), conn, adOpenStatic, adLockReadOnly
If rec.RecordCount > 0 Then
rec.MoveFirst
Do Until rec.EOF
TableName(j) = rec.Fields(0).Value
DatabasePath(j) = rec.Fields(1).Value
NO_of_Records(j) = rec.Fields(2).Value
rec.MoveNext
j = j + 1
Loop
End If
conn.Close
Set conn = Nothing




End Sub
ASKER CERTIFIED SOLUTION
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aiysha

ASKER

I changed the method to DAO..