Return no records if FIndKey results in False?

Posted by jwilfong on Stack Overflow See other posts from Stack Overflow or by jwilfong
Published on 2010-03-28T07:50:40Z Indexed on 2010/03/28 7:53 UTC
Read the original article Hit count: 187

Filed under:
|

Using TDataSet.FindKey you can locate records. When it results in True the datasets cursor will be positioned on the found record. When it results in False the cursor is not moved. This results in the record data prior to FindKey being issued being displayed in data aware components.

How can I code the result of FindKey to return an empty record?

    if Not tblSomeTable.FindKey([SomeSearchData]) then
    begin
        < code to return empty or move data cursor to neutral position >
    end;

Thanks, John

© Stack Overflow or respective owner

Related posts about delphi

Related posts about tdataset