Created attachment 201840 [details] test.odb Steps to reproduce. 1. Download the attached files test.odb and test.db to a folder (in my case it's C:\temp). The SQLite file test.db contains one table "test" with one field "name". The "test" table has one record with the value of the field "name" equal to "A". 2. Install jdbc driver for SQLite. I downloaded the driver from the link [1]. 3. Change the path to the test.db file in test.odb. Test the connection. 4. Run the following macro (after adjusting the path C:\temp). A new Calc file will be created, which will contain the result of the SQL query. Cell C2 is equal to 0. Must be "A". Sub TestSQLite() Dim fileURL As String, sqlQuery As String Dim oDoc As Object, oRange As Object Dim props(3) As New com.sun.star.beans.PropertyValue fileURL=ConvertToURL("C:\Temp\Test.odb") ' ** !! ** sqlQuery="Select name, name || '' strexp from Test" oDoc = StarDesktop.LoadComponentFromUrl("private:factory/scalc", "_blank", 0, Array()) props(0).Name="DatabaseName" : props(0).Value=FileURL props(1).Name="SourceType" : props(1).Value=1 props(2).Name="SourceObject" : props(2).Value=sqlQuery props(3).Name="IsNative" : props(3).Value=True oRange=oDoc.Sheets(0).GetCellRangeByName("A1") oRange.doImport props End Sub [1]. https://github.com/xerial/sqlite-jdbc
Created attachment 201841 [details] test.db
Correction to the opening message. Instead of Cell C2 is equal to 0. should read Cell B2 is equal to 0.