Board index » delphi » Findkey does not find record

Findkey does not find record

Hi all, I'm stumped.... any help is appreciated.

Paradox table with compound primary key (1st two fields of type
alphanumeric). Verified Record is present. Table is not filtered or ranged.

Findkey returns false (does not locate record).
    if not tblTpltItem.FindKey([SavePriorityTemplate,
tblItemMstr.FieldByName('IMst_ItemID').AsString]) then begin

SetKey/GoToKey reports that field is not indexed and cannot be assigned.
    tblTpltItem.SetKey;
    tblTpltItem.FieldByName('TPLI_TemplateID').asstring  :=
SavePriorityTemplate;
    tblTpltItem.FieldByName('TPLI_ItemID').asstring          :=
tblItemMstr.FieldByName('IMst_ItemID').asstring;
    if not tblTpltItem.GoToKey then begin

Rebuilt tables/indexes using Paradox 8 Rebuild.  Restored a previous known
good table (operates find on previous version of executable).

*(Bill. (TeamB) Tried to locate www.rdsolution.cz.  Got a DNS error.

 

Re:Findkey does not find record


It is www.rksolution.cz. Sorry for the typo.

From your description it sounds like the primary index is not the
active index when you call FindKey. Try adding the line

Table1.IndexName := '';

substituting the name of your TTable, right before your call to
FindKey and see if that makes a difference.

On Mon, 3 Jun 2002 09:52:23 -0700, "Dennis Dean"

Quote
<Dennis_Dea...@yahoo.com> wrote:
>Hi all, I'm stumped.... any help is appreciated.

>Paradox table with compound primary key (1st two fields of type
>alphanumeric). Verified Record is present. Table is not filtered or ranged.

>Findkey returns false (does not locate record).
>    if not tblTpltItem.FindKey([SavePriorityTemplate,
>tblItemMstr.FieldByName('IMst_ItemID').AsString]) then begin

>SetKey/GoToKey reports that field is not indexed and cannot be assigned.
>    tblTpltItem.SetKey;
>    tblTpltItem.FieldByName('TPLI_TemplateID').asstring  :=
>SavePriorityTemplate;
>    tblTpltItem.FieldByName('TPLI_ItemID').asstring          :=
>tblItemMstr.FieldByName('IMst_ItemID').asstring;
>    if not tblTpltItem.GoToKey then begin

>Rebuilt tables/indexes using Paradox 8 Rebuild.  Restored a previous known
>good table (operates find on previous version of executable).

>*(Bill. (TeamB) Tried to locate www.rdsolution.cz.  Got a DNS error.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Other Threads