Code: Select all
qryMain.SQL.Text := 'SELECT 1 FROM nonexistingtable';
try
qryMain.Execute;
except
on E: Exception do
begin
end;
end;
qryMain.SQL.Text := 'SELECT 2';
qryMain.Execute;I need to use the Execute method instead of Open because I don't know what SQL the user will use.