ADODB.Recordset and SQL

J

James

Is my logic off?

I have a lot of data in a recordset and I want to go through and pull
certain rows is that possible? If so how? I really have no clue.
Thanks.

SQL stmt would look something like

Select * FROM adodb.recordset Where OfferingID = <id number here>


Thanks!
 
D

Dirk Goldgar

James said:
Is my logic off?

I have a lot of data in a recordset and I want to go through and pull
certain rows is that possible? If so how? I really have no clue.
Thanks.

SQL stmt would look something like

Select * FROM adodb.recordset Where OfferingID = <id number here>

You can't run a SQL statement to select from a recordset. If you know
in advance what subset of rows you want, it's better just to open the
recordset on a SQL statement that returns just those rows. However, if
you are just presented with a recordset and want to filter it to just
the rows you want, you can use the ... wait for it ... Filter property
of the recordset to do that. For example,

Dim rs As ADODB.Recordset

' ... some code here gives us a big set of rows ...

' Filter just to the rows we want.
rs.Filter = "OfferingID = " & <ID number here>

' ... do something with the filtered rows ...

' Remove the filter.
rs.Filter = ""
 
J

James

Thanks for the help. I changed how I'm trying to do it... but still
having problems. I posted the new way I'm trying under
microsoft.public.access

"how to append a record to a recordset from a filtered recordset"

If you think you can help, check out that post. Thanks.
 
Top