Recent

Author Topic: Sqlite Query causes application to terminate with improper query string  (Read 760 times)

zorfox

  • Newbie
  • Posts: 5
I have been trying to learn how to use Sqlite with LAMW. Unfortunately, I had problems querying data. Rather than seeing an error the application terminates. I reviewed the DEMO projects in particular, AppDBGridViewDemo1. To my surprise the same issue was present. If I clicked the add data button the application would terminate.

Long story short, it was a simple typo in my query string, something like this,  jSqliteDataAccess1.Select('SELECT title FROM  myTable WHERE name = 'Whatever') would cause the application to terminate without warning. I finally saw it after several hours and added,

  aQuery := jEditText2.Text;
  if jSqliteDataAccess1.Select(aQuery) = '' then
    begin
      Showmessage(' There is an error in your SQL Query');
      exit;
    end else...Continue on


The error in AppDBGridViewDemo1 arises  when sdaFDR.InsertIntoTableBatch(stmtArray)  is called. Adding this prevents the application from terminating yet obviously does not correct anything.

        if sdaFDR.InsertIntoTableBatch(stmtArray) = false then
          begin
            Showmessage('Houston, We have a problem!');
            exit;
          end else

        TryUpdateView; //Refresh grid view.... 

It would be nice if the jSqliteDataAccess had error control to prevent this? I'm not complaining AT ALL. I appreciate all the hard work everyone involved provides. Just a heads up.
« Last Edit: September 17, 2019, 09:48:58 pm by zorfox »

 

TinyPortal © 2005-2018