Powerbasic Museum 2020-B

Webmaster: José Roca (PBWIN 10+/PBCC 6+) (SDK Forum) => COM Programming => Topic started by: Norm Cook on June 29, 2014, 06:11:56 PM

Title: ADO View
Post by: Norm Cook on June 29, 2014, 06:11:56 PM
I have had good success using ADO to open Access Tables, but
having a problem with Access Queries, which I assume is the same as a View in ADO.
In DAO you can set a RecordSet to these Queries with a simple OpenRecordSet(QueryName) call.

However I get errors trying to open a recordset with these queries/views.

I have tried your EnumViews example and it correctly identified the queries.

The NWIND.mdb has a bunch of queries/views.  Could you provide a sample of how to
open a query and enumerate its data?

Thanks Jose.
Title: Re: ADO View
Post by: José Roca on June 30, 2014, 12:15:56 AM
As far as I know, you can't open a View with ADO. ADOX is an extension of ADO to ease some things when working with Access. You can create a View, but only Access will open it and display the records.
Title: Re: ADO View
Post by: Norm Cook on June 30, 2014, 04:36:06 PM
OK, thanks
From my googling, I found something like this

pRecordSet.Source = Variant$(pView.Command) ' I added the Variant$

(Got the pView by using your Enum Views Collection example.)

but it doesn't populate the rs.

I have a workaround, which is to just use the View/Query sql directly