Aiysha
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.OL EDB.4.0;Da ta Source=C:\Program Files\AiyshaTest\AiyshaTes t.mdb;Pers ist 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
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.OL
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER