Another Access bug
Posted: Tue 27 May 2014 09:18
qryMain is a TUniQuery, connected to an Access database.
An exception is raised the first time, because the table does not exist. The SQL is then changed to something that's valid, but on the 2nd execution, TUniQuery runs the original SQL, instead of the new SQL.
I need to use the Execute method instead of Open because I don't know what SQL the user will use.
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.