G
Guest
Greetings,
I am trying to execute the following code in MS Access 2000 (in a
separate module sheet). When I attempt to run this code, nothing happens
(nor does this routine appear in the list of available macros to run). If I
compile the modules (via "Debug", "Compile ..."), they seem to compile fine.
Could I be missing a reference? The references I currently have checked are
the following: Visual Basic for Applications, Microsoft Access 9.0 Object
Library, OLE Automation, Microsoft DAO 3.6 Object Library, Microsoft Windows
Common Controls 6.0 (SP6), Microsoft Outlook 9.0 Object Library, Microsoft
ADO Ext. 2.8 for DDL and Security, Microsoft ActiveX Data Objects Recordset
2.8 Library, and Microsoft ActiveX Data Objects 2.1 Library.
Any suggestions? Thanks in advance!
Sherwood
Sub ListAccessTables(strDBPath As String)
Dim catDB As ADOX.Catalog
Dim tblList As ADOX.Table
Set catDB = New ADOX.Catalog
' Open the catalog.
catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & strDBPath
' Loop through all the tables, but not queries,
' and print their names and types.
For Each tblList In catDB.Tables
If tblList.Type <> "VIEW" Then
Debug.Print tblList.Name & vbTab & tblList.Type
End If
Next
Set catDB = Nothing
End Sub
I am trying to execute the following code in MS Access 2000 (in a
separate module sheet). When I attempt to run this code, nothing happens
(nor does this routine appear in the list of available macros to run). If I
compile the modules (via "Debug", "Compile ..."), they seem to compile fine.
Could I be missing a reference? The references I currently have checked are
the following: Visual Basic for Applications, Microsoft Access 9.0 Object
Library, OLE Automation, Microsoft DAO 3.6 Object Library, Microsoft Windows
Common Controls 6.0 (SP6), Microsoft Outlook 9.0 Object Library, Microsoft
ADO Ext. 2.8 for DDL and Security, Microsoft ActiveX Data Objects Recordset
2.8 Library, and Microsoft ActiveX Data Objects 2.1 Library.
Any suggestions? Thanks in advance!
Sherwood
Sub ListAccessTables(strDBPath As String)
Dim catDB As ADOX.Catalog
Dim tblList As ADOX.Table
Set catDB = New ADOX.Catalog
' Open the catalog.
catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & strDBPath
' Loop through all the tables, but not queries,
' and print their names and types.
For Each tblList In catDB.Tables
If tblList.Type <> "VIEW" Then
Debug.Print tblList.Name & vbTab & tblList.Type
End If
Next
Set catDB = Nothing
End Sub