Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subset of an ADO recordset

Status
Not open for further replies.

mgardiner

Programmer
Jun 28, 2001
22
US
I have an ADO Recordset.
I want another Recordset that will have only One Row in it that is
the current row for the first Recordset. Can I do this with out requerying the
database off of some value. I would prefer to just tell the new recordset
which row in the old recordset I want it to have and have it in there.
Morgan
 
you can either set the .filter property, and use that same recordset, or if you want it to be a different rs object, .filter, then .clone the recordset. This sounds like what you're after.
-Bob
 
.filter only seems to work if you have a Field your filtering on.
I just want to say I want Record Number 345 and have a recordset of
that.
This is for a search by record on every field one record at a time.

I think I have it figured out though.
There might be a better or cleaner way to do it.
If anyone has suggestions I am always open to them.

------------------------------------------------------------------------------------
With msearchrs
Do Until RecordCount = msearchrs.RecordCount - 1
Do Until ColumnCount = msearchrs.Fields.Count - 1
DoEvents
Select Case FindMatch
Case Is = "Any Part Of Field"
If InStr(msearchrs.Fields(ColumnCount).Value, findvalue) Then
recordposition = msearchrs.AbsolutePosition
FindSearchEntireDatabase = recordposition
Exit Function
End If
End Select
ColumnCount = ColumnCount + 1
Loop
ColumnCount = 0
msearchrs.MoveNext
RecordCount = RecordCount + 1
Loop
NoRecord = 1
End With


 
filter only seems to work if you have a Field your filtering on.
I just want to say I want Record Number 345 and have a recordset of
that.
This is for a search by record on every field one record at a time.

I think I have it figured out though.
There might be a better or cleaner way to do it.
If anyone has suggestions I am always open to them.

------------------------------------------------------------------------------------
With msearchrs
Do Until RecordCount = msearchrs.RecordCount - 1
Do Until ColumnCount = msearchrs.Fields.Count - 1
DoEvents
Select Case FindMatch
Case Is = "Any Part Of Field"
If InStr(msearchrs.Fields(ColumnCount).Value, findvalue) Then
recordposition = msearchrs.AbsolutePosition
FindSearchEntireDatabase = recordposition
Exit Function
End If
End Select
ColumnCount = ColumnCount + 1
Loop
ColumnCount = 0
msearchrs.MoveNext
RecordCount = RecordCount + 1
Loop
NoRecord = 1
End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top