展开全部
Private Sub Command1_Click()
Dim Conn As New ADODB.Connection
Conn.CursorLocation = adUseClient
cnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\aa.mdb;Persist Security Info=False"
Conn.ConnectionString = cnstr
Conn.Open cnstr
Dim rs As New ADODB.Recordset
Set rs = Conn.OpenSchema(adSchemaTables)
Do Until rs.EOF
If InStr(1, rs!TABLE_NAME, "MSys") = 0 Then n=n+1
rs.MoveNext
Loop
msgbox n
rs.Close
Conn.Close
End Sub
Dim Conn As New ADODB.Connection
Conn.CursorLocation = adUseClient
cnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\aa.mdb;Persist Security Info=False"
Conn.ConnectionString = cnstr
Conn.Open cnstr
Dim rs As New ADODB.Recordset
Set rs = Conn.OpenSchema(adSchemaTables)
Do Until rs.EOF
If InStr(1, rs!TABLE_NAME, "MSys") = 0 Then n=n+1
rs.MoveNext
Loop
msgbox n
rs.Close
Conn.Close
End Sub
追问
能列出表的名字吗?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询