|
-
Apr 13th, 2001, 06:47 AM
#1
Thread Starter
Addicted Member
Hi,
I have been populating a RecordSet with all the records of a table:
Set Rst = New ADODB.Recordset
wSQL = "Select * from CUSTOMERS Order by CustName"
Rst.Open wSQL, Conn, adOpenDynamic, adLockOptimistic
How can I find a specific record in this RecordSet using the Filter method?
Note: If I find the record I'm looking for, I need to delete it and move the pointer of the RecodSet to the Next record or Previous record.
I can't re-populate the RecordSet every time I delete a record (it has a lot of records and I think this would be a little slow).
I think that the Filter method is the best way to solve this, but how to use it?
Thanks in advance...
Michel Jr.
-
Apr 13th, 2001, 06:58 AM
#2
Addicted Member
Why don't you just refine your query to it?
Like this:
Code:
Set Rst = New ADODB.Recordset
wSQL = "Select * from CUSTOMERS where CustName = ' Michel' Order by CustName"
Rst.Open wSQL, Conn, adOpenDynamic, adLockOptimistic
You recordset will only contain the records which contain Michel in the field 'CustName'.
easy...
Big benefit is that your recordset is not so big.
-
Apr 13th, 2001, 07:25 AM
#3
Hyperactive Member
Not that I don't have the same concerns as Morphman2000
Rst.Filter = "CustName = '" & varName & "'"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|