Sqlite RowSet Error (xojo 2025 2.1)

Var f As FolderItem
Var RsCnTotal As RowSet
Var RsGnTotal As RowSet
Var StrSql As String
Var i As Integer

Var ConnDB As SQLiteDatabase = OpenDB()

f = New FolderItem(TxtExcel.Text, FolderItem.PathModes.Shell)

If (f<> Nil) Then

Try

Var wb As ExcelWorkbook =ExcelDb.Workbooks.Open(f.NativePath)
Var wsPerson As ExcelWorksheet = wb.Worksheets.Item("Personales y Consumo")
Var wsHipoteca As ExcelWorksheet = wb.Worksheets.Item("Hipotecas y Comerciales")

StrSql="SELECT *  FROM CN_Total WHERE RunType='CN_Total' AND Sucursal='Oficina Central' GROUP BY AccName,Sucursal ORDER BY Sucursal"
RsCnTotal=ConnDB.SQLSelect(StrSql) <<< Type mismatch error.  Expected class RowSet, but got class RecordSet

i=6 // star index of excel row for update with DB file

Do
  wsPerson.Range("B" + Str(i)).Text=""
  i=i+1
Loop Until (RsCnTotal.EOF=True)



//StrSql="Select * From GM_Total"
//RsCnTotal=ConnDB.SQLSelect(StrSql)

//wb.Save
wb.Close
ExcelDb.Quit

Catch

End Try
Else
MsgBox(“Excel File no Found !”)
Exit

End If

You are using SQLSelect instead of SelectSQL.
You may want to review the documentation about RowSet, RecordSet, SQLSelect, SelectSQL, etc.

1 Like

SelectSQL is the newer one (API2) where you can give parameters which inserted secured into sql query.

SelectSQL(query As String, ParamArray values() As Variant) As RowSet

ok

thanks