Recordset Find in 2000

  • Thread starter Thread starter Abbarition
  • Start date Start date
A

Abbarition

I have a database I am in the process of converting from
Access97 to Access2000. In 97, I used
Recordset.FindFirst and Recordset.NoMatch to find if
there was a record that matched my criteria. In
converting to 2000, I no longer have those options (I'm
try to avoid adding the DAO reference). Can anyone tell
me if the best way to go about this now is to use
Recordset.Find and then Recordset.EOF=True if it cannot
find the record?

Also, in 97 I was trying to find where the criteria
matched in two fields. For example, my code was:
rst.FindFirst "[fld1] = 1 And [fld2] = 2"
In 2000, I get an error any time I try to use the
criteria on more than one field. Is there a different
way to search for 2 fields in 2000?

Thanks so much!
 
I don't. I am trying to find out the best way to begin
using the ADO code.
-----Original Message-----
How can you expect to continue using DAO code, but not add the DAO
reference?

TC


I have a database I am in the process of converting from
Access97 to Access2000. In 97, I used
Recordset.FindFirst and Recordset.NoMatch to find if
there was a record that matched my criteria. In
converting to 2000, I no longer have those options (I'm
try to avoid adding the DAO reference). Can anyone tell
me if the best way to go about this now is to use
Recordset.Find and then Recordset.EOF=True if it cannot
find the record?

Also, in 97 I was trying to find where the criteria
matched in two fields. For example, my code was:
rst.FindFirst "[fld1] = 1 And [fld2] = 2"
In 2000, I get an error any time I try to use the
criteria on more than one field. Is there a different
way to search for 2 fields in 2000?

Thanks so much!


.
 
I don't. I am trying to find out the best way to begin
using the ADO code.

I'm afraid the best way is to use DAO. If you have to use ADO because you
need to interact with a real database, then you need to start addressing
client/ server paradigms, like getting the server to do the checking for
you.

In short you just don't get a whole recordset and search it; you get a
filtered recordset. So

rs.FindFirst "FullName = ""Eric"""

is completely replaced by

SELECT This, That, TheOther FROM Somewhere
WHERE FullName = 'Eric'

and so on. When you get out of you car and learn to swim, there is just no
point in asking how to shift gears in the water. It's as different as that.

Best wishes


Tim F
 
Back
Top