Delphi Examples: DbiExtractKey

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Delphi Examples: DbiExtractKey

Return to chapter overview

Extract the key value for the current record.

This example assumes the field is of type character and uses the following input:

 fDbiExtractKey(Table1.Handle, KeyValue);

 

The procedure is defined as:

procedure fDbiExtractKey(hTmpCur: hDBICur; var KeyBuff: string);

var

 P: PChar;

 Props: CurProps;

begin

 Check(DbiGetCursorProps(hTmpCur,Props));

 GetMem(P, Props.IkeySize);

 Check(DbiExtractKey(hTmpCur, nil, P));

 KeyBuff:= StrPas(P);

 FreeMem(p, Props.IkeySize);

end;