<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="default-style">
I need to find records in an indexed dBase file based on a key.
</div>
<div class="default-style">
version is 2.2.6 fpc 3.2.2 x86_64.
</div>
<div class="default-style">
</div>
<div class="default-style">
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
</div>
<div class="default-style">
record in the data base, so editing can be done, without going through record by record.
</div>
<div class="default-style">
</div>
<div class="default-style">
procedure Ttempf.Edit1Exit(Sender: TObject);<br>var<br> tempid : string;<br> tno : string;<br>begin<br> tempid := edit1.text;<br> <br> if<br> temp.Locate('temp_no', (tempid),[loPartialkey])<br> then<br> begin<br> <br> showmessage('we found the field or Partial' + tempid);<br> showmessage('current temp_no is ');<br> tno := temp.FieldbyName('temp_no').asString;<br> showmessage('tempno is = ' + tno);
</div>
<div class="default-style">
end;
</div>
<div class="default-style">
</div>
<div class="default-style">
The above code, executes the 'then', shows me what was searched for BUT when a
</div>
<div class="default-style">
data field is displayed, the original record is pointed to, NOT a record further in the database.
</div>
<div class="default-style">
</div>
<div class="default-style">
Driving myself crazy trying to find problem, It is a short drive, many times.
</div>
<div class="default-style">
any Help would be appreciated.
</div>
<div class="default-style">
</div>
<div class="default-style">
john@mbstemps.com
</div>
<div class="default-style">
</div>
<div class="io-ox-signature">
<p class="default-style"><span style="color: #000080;"><strong>John A. Ward, President</strong></span></p>
<p class="default-style"><span style="color: #000080;"><strong> </strong></span></p>
</div>
</body>
</html>