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

Mark H Lists at theopg.com
Wed Jul 2 10:55:41 CDT 2003


Was sloppy copy and pasting... Took out the extra provider setting and
it still wont play.

Cheers

Mark

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte
Foust
Sent: 02 July 2003 16:29
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] OT ADOX - Cycle though columns in a view


You're using two different provider strings for no reason I can see. Use
the Jet OLEDB provider.  You don't need MSDASQL for this.  "Queries" are
either views or stored procedures in ADO in 2000, although I seem to
recall XP having a Queries collection as well.  You won't find them in
the tables collection of a Jet database using ADO.

Charlotte Foust

-----Original Message-----
From: Mark Hayes [mailto:mdh at theopg.com] 
Sent: Wednesday, July 02, 2003 5:14 AM
To: 'Accessd at Databaseadvisors. Com'
Subject: [AccessD] OT ADOX - Cycle though columns in a view


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

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list