[Lazarus] locate command for dBase

john Ward john at mbstemps.com
Fri May 26 02:12:17 CEST 2023


I need to find records in an indexed dBase file based on a key.
version is 2.2.6 fpc 3.2.2  x86_64.
 
The following is the test I did in the program. The dBase file is temp.dbf and the index if temp.mdx; The program includes tDbf and tDatasource. I also have tDbnavigator in the program, all seems to be working, adding, editing records. I need to be able to 'find' a
record in the data base, so editing can be done, without going through record by record.
 
procedure Ttempf.Edit1Exit(Sender: TObject);
var
   tempid : string;
   tno : string;
begin
     tempid := edit1.text;
 
  if
  temp.Locate('temp_no', (tempid),[loPartialkey])
  then
  begin
   
    showmessage('we found the field or Partial' + tempid);
    showmessage('current temp_no is ');
    tno := temp.FieldbyName('temp_no').asString;
   showmessage('tempno is = ' + tno);
    end;
 
The above code, executes the 'then', shows me what was searched for BUT when a
data field is displayed, the original record is pointed to, NOT a record further in the database.
 
Driving myself crazy trying to find problem, It is a short drive, many times.
any Help would be appreciated.
 
john at mbstemps.com
 

John A. Ward, President

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230525/627e2891/attachment.htm>


More information about the lazarus mailing list