Find on more FIELDS with ADO

Find on more FIELDS with ADO

Postby Marc Vanzegbroeck » Thu Oct 18, 2012 6:12 am

Hi,

I'm convering my programs from DBF to ADO.
I have also a find thad the user can find a record in a list with criteria on more than one field.
With DBF I could do a locate for FIELD1 =.. .and. FIELD2=...
How can I do this with ADO on a recordset.

According to the info of the FIND-methode I can only specify 1 field.

Required. The column name, comparison operator, and value to use in the search.
Examples:

"Country='Norway'"
"Date>#7/22/97#"
"Country LIKE N*"

Note: This method does not support multi-column searches (AND or OR)


I don't want to use the filter-property, because I want to show everything. I only want to go to that record.
I also looking for a replacement for a locate next...

I thought maybe running a second recordset with a query, and remembering the ID-number, a jump in my first recordset to that ID. When I to a 'Find Next', I jump to the second one.
But it would be easyier, just with something like FIND...
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Find on more FIELDS with ADO

Postby Enrico Maria Giordano » Thu Oct 18, 2012 8:45 am

Marc Vanzegbroeck wrote:I don't want to use the filter-property, because I want to show everything. I only want to go to that record.
I also looking for a replacement for a locate next...

I thought maybe running a second recordset with a query, and remembering the ID-number, a jump in my first recordset to that ID. When I to a 'Find Next', I jump to the second one.
But it would be easyier, just with something like FIND...


Can't you use the same technique using filters?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Find on more FIELDS with ADO

Postby Marc Vanzegbroeck » Thu Oct 18, 2012 10:33 am

Enrico Maria Giordano wrote:Can't you use the same technique using filters?
EMG


Indeed, I will try it.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 81 guests