Sometime for some reasons, we need to locate some values from adoquery result. Below is the function to do that :
if AdoQuery.Locate('NAME', 'jhon', [loPartialKey, loCaseSensitive]) then
Showmessage('Data is found')
else
Showmessage('Data not found');
If you want to locate in more than 1 field you can use ';' as code below :Showmessage('Data is found')
else
Showmessage('Data not found');
AdoQuery.Locate('Name;Address',VarArrayOf(['jhon','Arizona']),[]);
The last parameter is optional. You can leave it blank of fill it with 'loPartialKey' or 'loCaseSensitive' as your need.
No comments:
Post a Comment