Hi all,
one of the users of my app reports a problem.
The error message is:
"SQLiteException: Unable to close due to unfinalised statements - Continue? Yes/no"
The error appears when running this sub:
I don't have any idea, why this happens.
Anyone any idea to lead me the way?
Best regards,
Carsten
one of the users of my app reports a problem.
The error message is:
"SQLiteException: Unable to close due to unfinalised statements - Continue? Yes/no"
The error appears when running this sub:
B4X:
Sub listfill
Main.iconlist.initialize
Main.sql1.Initialize(Main.sddirectory,"copysmiley.db",True)
Main.sql1.BeginTransaction
Dim cursor1 As Cursor
If Main.selectedcat = "" Then cursor1 = Main.sql1.ExecQuery("SELECT url FROM table1")
If Main.selectedcat = Main.alltext Then cursor1 = Main.sql1.ExecQuery("SELECT url FROM table1")
If Main.selectedcat <> "" AND Main.selectedcat <> Main.alltext Then
cursor1 = Main.sql1.ExecQuery("SELECT url FROM table1 WHERE category = '" & Main.selectedcat & "'")
End If
i = 0
y = 10
For i = cursor1.RowCount - 1 To 0 Step -1
cursor1.Position = i
Main.IconList.Add(cursor1.GetString("url"))
Dim cursor2 As Cursor
cursor2 = Main.sql1.ExecQuery2("SELECT image FROM table1 WHERE url = ?",Array As String(cursor1.GetString("url")))
cursor2.Position = 0
Dim Buffer() As Byte 'declare an empty byte array
Buffer = cursor2.GetBlob("image")
Dim InputStream1 As InputStream
InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
Dim bd As Bitmap
bd.Initialize2(InputStream1)
InputStream1.Close
s = bd
imgHeight = 40dip
imgWidth = 40dip * s.Width / s.height
If imgWidth > breite Then
imgWidth = breite - 5
End If
If x > breite - imgWidth Then
x = 10
y = y + 60dip
End If
Dim imvImage As ImageView
imvImage.Initialize("imvImage")
imvImage.Gravity=Gravity.FILL
imvImage.Tag=cursor1.GetString("url")
imvImage.Bitmap=s
scvImages.Panel.AddView(imvImage,x,y,imgWidth,imgHeight)
x = x + imgWidth + 30
Next
Main.sql1.TransactionSuccessful
Main.sql1.EndTransaction
cursor1.Close
cursor2.close
Main.sql1.close
SaveButton.Visible = True
scvImages.Visible = True
scvImages.Panel.Color = Colors.Yellow
scvImages.Panel.Height = y + 200
ToastMessageShow(scvImages.Panel.NumberOfViews & " Smileys " & Main.loadedtext,False)
End Sub
I don't have any idea, why this happens.
Anyone any idea to lead me the way?
Best regards,
Carsten