Does anyone know how to use ADO to A) get a list of table names and B) get the date & time that the table was last modified?
Printable View
Does anyone know how to use ADO to A) get a list of table names and B) get the date & time that the table was last modified?
You can use ADO OpenSchema to get tablenames, but I am not sure whether you can get date using that.
Code:'uses ADO 2.x and Ado 2.x Ext for DDL and Security
Dim objCn As New Connection
Dim objCat As ADOX.Catalog
Dim objProc As ADOX.Procedure
Dim objTable As ADOX.Table
objCn.Open <connectionstring>
Set objCat = New Catalog
objCat.ActiveConnection = objCn
For Each objTable In objCat.Tables
Debug.Print objTable.Name & ": " & objTable.DateModified
Next objTable
objCn.Close
Set objCat = Nothing
Set objCn = Nothing