[AccessD] OT ADOX - Cycle though columns in a view

Mark Hayes mdh at theopg.com
Wed Jul 2 08:14:24 CDT 2003


Hello

I am trying to get at the views in an adox.catalog (using XP)

Sub bTest()
'uses adox
    Dim strCon As String
    Dim cat As ADOX.Catalog
    Dim vw As ADOX.View
    Dim Conn As New ADODB.Connection
    
    strCon = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
Source=E:\Data\db1.mdb"
    
    Conn.Provider = "MSDASQL"
    Conn.Open strCon

    Set cat = New ADOX.Catalog
    
    cat.ActiveConnection = Conn
    
    For Each vw In cat.Views
	debug.Print vw.Name
    Next

End Sub

I can get at the tables in the same way but not queries. I read that
queries in mdb's are listed as tables, but they still don't show up in
the tables collection. Cat.views.count always comes back 0

Is this because mdbs aren't fully supported by adox perhaps?

Any ideas much appreciated

Mark



More information about the AccessD mailing list