Link to home
Start Free TrialLog in
Avatar of wildzero
wildzero

asked on

Adotable Locate problem

Hey there :)

If I do this
   
  If ADOTable1.Locate('Name', 'Joh', [loPartialKey, loCaseInsensitive]) then
    showmessage(Adotable1.FieldByName('Name').Value);

I get a message saying, John

Now if I do this
  If ADOTable1.Locate('Name', 'oh', [loPartialKey, loCaseInsensitive]) then
    showmessage(Adotable1.FieldByName('Name').Value);

I get nothing.....
How can I fix this or what else can I do?
Avatar of Wim ten Brink
Wim ten Brink
Flag of Netherlands image

Locate will only find values that START with the key that you have specified. Thus it should find Ohio but not John... Maybe you can use a wildcard character like an ? or * instead but I wouldn't count on it. (Can't test it myself.)
ASKER CERTIFIED SOLUTION
Avatar of Wim ten Brink
Wim ten Brink
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wildzero
wildzero

ASKER

Yea I think that will do it for 1 char (? = 1 of anything) so I just slapped in a % so
'%oh' works fine
same with '%h'

thanks very much for the fast reply