Hello Aijun
this macro list the Access tables . you may use it to check if a tabl
exist
i hope this help you
Sub ListTables()
Dim Conn As ADODB.Connection
Dim rsT As ADODB.Recordset
Set Conn = New ADODB.Connection
With Conn
.Provider = "Microsoft.JET.OLEDB.4.0"
.Open ThisWorkbook.Path & "C:\MaBase_V01.mdb"
End With
Set rsT = Conn.OpenSchema(adSchemaTables)
While Not rsT.EOF
If rsT.Fields("TABLE_TYPE") = "TABLE" Then _
Debug.Print rsT.Fields("TABLE_NAME")
rsT.MoveNext
Wend
Set rsT = Nothing
Conn.Close
End Sub
regards
miche
--
michelxl
-----------------------------------------------------------------------
michelxld's Profile:
http://www.excelforum.com/member.php...fo&userid=1736
View this thread:
http://www.excelforum.com/showthread.php?threadid=39799