[yunqa.de] Re: DISQLite3 Personal

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Sat, 29 Mar 2014 15:38:42 +0100

On 28.03.2014 14:26, Michael Schipp wrote:

if stmt <> nil then
   throw error at use and do not do step statement.

Do not rely on the fact that TDISQLite3Database.Prepare() returns nil in case of error. It does raise an exception in case of error, but does not necessarily return nil.

It is better to catch the exception like this:

try
  Stmt := FDatabase.Prepare(SelectSQL);
except
  on e: ESQLite3 do
    ShowMessage(e.ErrorMessage);
end;

Ralf
_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: