[DUG] Searching ClientDataSet using locate
Robert martin
rob at chreos.co.nz
Thu Nov 6 16:52:50 NZDT 2008
Hi John
.Locate('Field1;Field1', VarArrayOf([Variable1, Variable2])
Works fine for me (all over the place but just with std TDataset)
John Bird wrote:
> I am trying to make a generalised routine for searching a client dataset (it
> searches alpha fields matching a user supplied string and positions on the
> next matching record).
>
> So far I am doing this using the locate command like:
>
> if
> cdsFind.locate(FindFieldName,FindString,[loPartialKey,loCaseInsensitive])
> then
>
>
> 2 questions:
>
> Q1 - loPartialKey matches from the beginning of the alpha field text, is
> there anyway to search anywhere within the alpha field not just match at
> the begininng?
>
> Q2 - I would like to do the locate on several alpha fields - having trouble
> getting the locate sysntax to work for several fields (variant arrays). I
> have examples how to do it locating one of several constant strings (using
> VarArrayOf to make the second parameter as a variant array), but not for one
> string that is in a variable. Does anyonehave a working example of locate
> on multiple fields finding contents of a string variable.
>
> Notes:
>
> -When I get this working happy to share it
>
> - I have to do this with something like locate that doesn't change the recno
> until done, as the scroll event is slow for some datasets I want to use it
> on.
>
>
>
> John
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe
>
>
More information about the Delphi
mailing list