|
-
Apr 16th, 2002, 12:46 PM
#1
Thread Starter
Hyperactive Member
Help! - ADO navigation...
Hey All,
I don't appear to have the seek function, maybe that's just for DAO, but what I need to do is:
Search for a field which contains a specific value and position the cursor accordingly.
My datasource is a data-aware class, which is populated from a delimited text-file. I uses the append methods to add fields to a recordset.
Any idea on how I can accomplish this would be greatly appreciated.
TIA.
-
Apr 16th, 2002, 01:00 PM
#2
you can use
objrs.find "fieldname = criteria"
Is this what you wanted?
-
Apr 16th, 2002, 01:07 PM
#3
Thread Starter
Hyperactive Member
Oh, now I remember the problem, it's not possible to have a variable value for the criteria, right?
What do I do?
Last edited by Dodger; Apr 16th, 2002 at 01:14 PM.
-
Apr 16th, 2002, 01:12 PM
#4
I don't wish to say "you're welcome"!!!
OK NOW I DO!
You're welcome

-
Apr 16th, 2002, 01:22 PM
#5
Fanatic Member
Originally posted by Dodger
Oh, now I remember the problem, it's not possible to have a variable value for the criteria, right?
What do I do?
yep 
VB Code:
rs.Find "Field1 = '" & strMyString & "'"
-
Apr 16th, 2002, 01:28 PM
#6
Thread Starter
Hyperactive Member
-
Apr 16th, 2002, 01:31 PM
#7
Thread Starter
Hyperactive Member
Oh, one more question.
Is it possible to use the find function with multiple criteria?
-
Apr 16th, 2002, 01:33 PM
#8
Fanatic Member
indeed 
VB Code:
rs.Find "Field1 = 'blah' AND Field2 = 'snuh'"
-
Apr 16th, 2002, 01:38 PM
#9
Fanatic Member
oops, just looked that up on MSDN (wasn't too sure about it), and apparetly you can't. i'm sure i've done it though...
-
Apr 16th, 2002, 01:41 PM
#10
Thread Starter
Hyperactive Member
Could you tell me how you did it?
-
Apr 16th, 2002, 01:45 PM
#11
Fanatic Member
well, i thought i did it like in the last example i posted, but then i looked at this on MSDN:
Find Method
The ActiveX Data Objects (ADO) version of the Find Method supports only singular column searches. As a result, using the "And" or "Or" keywords to append criteria will not work.
Creating a new recordset will frequently provide better performance and does not limit you to single column filters.
but that's confused me. first they say the Find method only supports singular column searches, then in the next sentence, they say it supports multiple searches! 
try using the code i just posted anyway
-
Apr 16th, 2002, 01:48 PM
#12
Thread Starter
Hyperactive Member
I tried this and it didn't work:
dataContacts.Find "fName = '" & fldVal(0) & "' AND lName = '" & fldVal2(1) & "'"
-
Apr 16th, 2002, 01:55 PM
#13
Fanatic Member
the only thing i can suggest is to see what version of ADO you're using. other than that i'm not sure.
-
Apr 16th, 2002, 02:05 PM
#14
Thread Starter
Hyperactive Member
-
Apr 16th, 2002, 02:09 PM
#15
Fanatic Member
yeah, that's what i have referenced in my project... i'm sure it's possible somehow, but seeing as i don't have VB6 on this PC i can't try anything. sorry.
-
Apr 16th, 2002, 04:11 PM
#16
Thread Starter
Hyperactive Member
Thanks Anyway.
-
May 2nd, 2002, 04:23 PM
#17
Member
You can use .Filter with multiple criteria, but not .Find.
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
|