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.
 
j...@mbstemps.com
 

John A. Ward, President

 
-- 
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to