message when the qbe has 0 records

rdiez

Member²
Hi! I need to return a message when the QBE
result is 0 records and then refresh the dataset with the complete records.

Thanks.
 
Something like this?
Code:
procedure TMainForm.EmpNavigatorClick(Sender: TObject; Button: TOracleNavigateBtn);
var DataSet: TOracleDataSet;
begin
  if Button = nbExecuteQBE then
  begin
    DataSet := TOracleNavigator(Sender).DataSource.DataSet as TOracleDataSet;
    if DataSet.RecordCount = 0 then
    begin
      ShowMessage('No matches, showing all records');
      DataSet.QBEMode := True;
      DataSet.ToggleQBEValues;
      DataSet.ExecuteQBE;
    end;
  end;
end;

------------------
Marco Kalter
Allround Automations
 
Back
Top