Re: database search

Posted by Jenny on June 18, 2005

In Reply to: database search posted by toshesk on June 17, 2005

: i've created a database and connect it to a form with Grid and everything works like it should... but when i try to write a code who would search the base by word or by letter i could not think on anithing can anyone please help me and tell me the code so i can finish my program
thanks

If the Delphi table is indexed on the field "FirstName", you find the record where FirstName is "Jenny" with:

Table1.FindKey(['Jenny']);

If there is no index on a field, you can use Locate, for example:

Table1.Locate('FirstName', 'Jenny', []);

Have a look at Delphi's Help before you use these functions ;)

Cheers,
Jenny

Related articles

Turbo Delphi Explorer
Database programming with the latest FREE Delphi version. Download and install!