Query "doesn't return a valid result set" - but it does!

I hope that I can describe this sufficiently without going into a lot of detail.

I have written a query which generates an ‘Answer’ table which is then used in a report. This worked in the embedded HSQLDB of LO Base. Now I have transferred the data to an external SQLite database, accessed from LO through an ODBC driver. This required some minor changes to the SQL statement that created the table. Basically, it still works, since the table is created and I can inspect it. However, the macro which runs the query and then should go on to open the report hangs up at the line oResult = oQuery.executeQuery(sSQL) (sSQL being the query string) and returns the SQL exception error “The execution of the query doesn’t return a valid result set.” Given that it does, I am uncertain where to look for a solution. I guess that writing an error handler to ignore the error (how?) might be a workaround - but not very desirable in principle!

Any offers?

Hello,

Can’t say I’ll be of help with SQLite DB being used. Have this installed on another system. Have a few postings about installing. Don’t use it personally and avoid it typically.

Noting here a link about error handling if you need → CalcBASIC+Non-registred HSQLDB : How to deal with .odb.lck ?

Also, it seems, and based upon other experience with different databases, the problem may be in the ODBC connector not handling some function in your code correctly. In that case you need to report → Bugzilla

Thank you. The error handler neatly sidestepped the problem and showed that the query statement executes and generates the intended result.

Shall leave it at that for the moment, until I see whether other queries throw up the same or similar problems.