• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

ADO View

Started by Norm Cook, June 29, 2014, 06:11:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Norm Cook

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.

José Roca

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.

Norm Cook

#2
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