I use this piece of code (from the Sams book) to search for a record in a db and I get the error message that the dataset is not in edit or insert mode (suppose this is because I use the SetKey command).
Can anybody tell me what's going wrong?
procedure TForm1.btnSearchClick(Sender: TObject);
CustInfo.IndexName := 'ByCompany';
CustInfo.FieldByName ('Company').asString := txtSearch.Text ;