vb怎么列举出一个mdb数据库里面所有表名
1个回答
展开全部
Dim conn As Object, rs As Object
Set conn = CreateObject("adodb.connection")
conn.Open "provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & mdb文件路径
Set rs = conn.OpenSchema(20)
Do Until rs.EOF
If rs("table_type") = "TABLE" Then
Print rs("table_name")
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询