More Group Sites
Education Books
School Rankings
Jobless Net
Better Home
Enviro++
更好教育论坛
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post Go to first unread
hong  
#1 Posted : Friday, October 10, 2014 9:40:33 AM(UTC)
hong

Rank: Administration

Reputation:

Groups: AcademicCoachingSchool, admin, Administration, BookSeller, CatholicSchool, CoachingAdult, CoachingProfessional, CoachingSports, ExtraCurriculumCoaching, IndependentSchool, Moderator, MusicTeacher, PrivateSchool, PublicSchool, SelectiveSchool, tutor
Joined: 11/23/2008(UTC)
Posts: 522

Locate or FindKey is used to test if a matching record exists.

Locate and FindKey both move the table cursor to the found record. Moving to another record posts the current record.

Locate can search on non-indexed fields. FindKey seems to be faster when searching on an index though, even though locate supposedly uses an index if there is one.

Use Locate to find an entry in a Table. If you have, for example, a name typed in an Edit and want to find the record
use:
Code:
TableGroup.Open; 
TableGroup.Locate('Name',Edit1.text,[]); 

after this the cursor is at this record, if it exists and you can read out other fields of this record.


Related:
Delphi FindKey problem

Edited by user Friday, October 10, 2014 9:43:53 AM(UTC)  | Reason: Not specified

Sponsor
Rss Feed  Atom Feed
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.