Click to See Complete Forum and Search --> : ADO recordset Find method, more than a field


October 21st, 1999, 03:09 AM
Hello!
I´m attached to a SQLServer 7.0 database.
I' m not able to pass more than a field for search in a criteria string
for the ADO recordset find method.

Imagine a recordset which has the contents of a table called books,
two of its fields are called idbook and bookname.
I would need a thing like:

rs.Find "idbook>2 and bookname like 'the%'"

When i use more than a column(field) for tyhe criteria string, i have an error
telling "the application is using wrong arguments,or out-of-range arguments". Always the same error number, 3001


Can anyone give me a solution for this?

Thanks for your help

nilch
October 21st, 1999, 05:04 AM
In ADO there is a limitation. In MSDN, this limitation is documentated. There is no way you can include two field conditions in the 'where' criteria statement for the find method. Can only used a one field search.

Trust Microsoft to mess up is own standards as it brings out newer controls and all.

Rob HErmans
October 21st, 1999, 06:47 AM
Yeh - Had the same problem
Ended up breaking all of cobb's et al data normalization standards.
What I did was to create a compound field of the fields I knew I had to "find" in my application.
For example create a field called ID_Title and stuff it with the concatenated fields
Cheers
Rob

Rob Hermans
October 21st, 1999, 06:47 AM
Yeh - Had the same problem
Ended up breaking all of cobb's et al data normalization standards.
What I did was to create a compound field of the fields I knew I had to "find" in my application.
For example create a field called ID_Title and stuff it with the concatenated fields
Cheers
Rob

Lothar Haensler
October 21st, 1999, 06:51 AM
msdn article Q195222 has all the details and workarounds for the limitation of the Find method.