set adoCN =createobject("ADODB.CONNECTION")
set strCnn =createobject("ADODB.Recordset")
set rstSchema =createobject("ADODB.Recordset")
Dim I
str1 = "DBQ=E:/data1.MDB;DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
adoCN.Open str1
i=adSchemaTables
Set rstSchema = adoCN.OpenSchema(20)
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.Close
MsgBox out