+ Fixed a crash when connecting to a database fails when using execsql on a query

git-svn-id: trunk@3829 -
This commit is contained in:
joost 2006-06-09 18:54:12 +00:00
parent fb9f8bb2a1
commit 90b40e9385

View File

@ -973,7 +973,9 @@ begin
Prepare;
Execute;
finally
if (not IsPrepared) and (assigned(database)) then (database as TSQLConnection).UnPrepareStatement(Fcursor);
// FCursor has to be assigned, or else the prepare went wrong before PrepareStatment was
// called, so UnPrepareStatement shoudn't be called either
if (not IsPrepared) and (assigned(database)) and (assigned(FCursor)) then (database as TSQLConnection).UnPrepareStatement(Fcursor);
end;
end;