ADO Recordsets

I am being passed a disconnected ADO recordset which I am navigating through.  If a particular record meets certain criteria I want to pass only this record onto another function for processing.  How do I do it?  I don't want to pass each individual field as a parameter as there are 20+ fields.

Who is Participating?
WalterMConnect With a Mentor Commented:
I assume you don't want to reconnect to issue another SQL query, or you wouldn't have used a disconnected recordset.
Have you considered using the .GetString or .Getrows methods of the ADO recordset? These allow you to retrieve only specific rows into a string or variant array.
Or you could use the SHAPE command to pack certain child rows into a field of a parent recordset. Then you can pass on the field, and the client can unpack it by assigning the field to a recordset. Although it isn't extremely hard, it takes some abstract thinking though to master the SHAPE SQL syntax.
Also, in ADO 2.5 Microsoft added a Record object. I haven't used it myself yet, but the MSDN provides some basic examples explaining it's use.

I hope I've been of some assistance.

Michel Rutten
ShaleyAuthor Commented:

After I posted this question I stumbled upon GetRows and have started implementing it.  You have confirmed my thinking.

Thanks for your time.


All Courses

From novice to tech pro — start learning today.