Hi all,
Im new to this forum and also new to VBA
I'm trying to use ADOX to get the list of tables, procedures and view using ADOX but get an error
"Run-time error '91'; Object variable or With block variable not set"
my code is shown below. I have added the ADO Ext. 2.7 DDL and Security library but the strange thing is the ADOX's comes back in lower case when all the others convert to upper case as I type. Could anyone shed some light on this please? thank you
Code:
Sub adox()
Dim cat As adox.Catalog
Dim cnn1 As ADODB.Connection
Dim tbl As adox.Table
Dim proc As adox.Procedure
Dim vie As adox.View
Set cnn1 = CurrentProject.Connection
cat.ActiveConnection = cnn1
For Each tbl In cat.Tables
Debug.Print "Tablename: " & tbl.Name
Next
For Each proc In cat.Procedures
Debug.Print "proc: " & proc.Name
Next
For Each vie In cat.Views
Debug.Print "view: " & vie.Name
Next
Set cnn1 = Nothing
End Sub