这是一个读出表名的程式,你参照一下:
Dim cnn As New ADODB.Connection
Dim cat As New ADOX.Catalog
Dim tbl As ADOX.Table
' 打开连接
cnn.Open _
"rovider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=d:\Program Files\Microsoft Office\" & _
"Office\Samples\Northwind.mdb;"
' 打开目录
Set cat.ActiveConnection = cnn
For Each tbl In cat.Tables
Debug.Print tbl.Name
Next
cnn.Close