Author Topic: ADO View  (Read 2894 times)

0 Members and 1 Guest are viewing this topic.

Offline Norm Cook

  • Newbie
  • *
  • Posts: 8
  • User-Rate: +0/-0
ADO View
« 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.

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2481
  • User-Rate: +204/-0
Re: ADO View
« Reply #1 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.

Offline Norm Cook

  • Newbie
  • *
  • Posts: 8
  • User-Rate: +0/-0
Re: ADO View
« Reply #2 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
« Last Edit: June 30, 2014, 04:37:53 PM by Norm Cook »