请问如何用ADO返回ACCESS库中的所有表名集合!(在线等,急用)
日期:2007-01-11 荐:
请问如何用ADO返回ACCESS库中的所有表名集合!(在线等,急用)谢谢转帖:得到access数据库表名Dim adoCN As New ADODB.Connection '定义数据库的连接Dim strCnn As New ADODB.RecordsetDim I As Integer 'str1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Northwind.MDB;Persist Security Info=False" adoCN.Open DataConnectString Set rstSchema = adoCN.OpenSchema(adSchemaTables) Do Until rstSchema.EOF If rstSchema!TABLE_TYPE = "TABLE" Then out = out & "Table name: " & _ rstSchema!TABLE_NAME & vbCr & _ "Table type: " & rstSchema!TABLE_TYPE & vbCr I = I 1 End If rstSchema.MoveNext Loop MsgBox I rstSchema.Close adoCN.CloseDebug.Print outDim CAT As ADOX.CatalogSet CAT = New ADOX.CatalogCAT.Tables.countCAT.Tables.Item(1).Name
标签: