用ADOX吧'引用Microsoft ActiveX Data Objects 2.X Library '引用Microsoft ADO EXT. 2.8 For DDL and Security Dim con As New ADODB.Connection con.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\123.mdb;Persist Security Info=False"
Dim ado As New adox.Catalog Set ado.ActiveConnection = con
Dim xx As Long, yy As Long For xx = 0 To ado.Tables.Count - 1 For yy = 0 To ado.Tables.Item(xx).Keys.Count - 1 Debug.Print ado.Tables.Item(xx).Keys.Item(yy).Name Next Next
'引用Microsoft ADO EXT. 2.8 For DDL and Security
Dim con As New ADODB.Connection
con.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\123.mdb;Persist Security Info=False"
Dim ado As New adox.Catalog
Set ado.ActiveConnection = con
Dim xx As Long, yy As Long
For xx = 0 To ado.Tables.Count - 1
For yy = 0 To ado.Tables.Item(xx).Keys.Count - 1
Debug.Print ado.Tables.Item(xx).Keys.Item(yy).Name
Next
Next
con.Close
Set con = Nothing