W winelover Member Licensed User Longtime User Dec 19, 2011 #1 Hello, I read the SQL tutorial and I was wondering how to check if a blob contains an image or not. I thought maybe the Buffer might be Null, but i get an error with that. Does anyone have a solution for me? Greetz, Mischa :sign0104:
Hello, I read the SQL tutorial and I was wondering how to check if a blob contains an image or not. I thought maybe the Buffer might be Null, but i get an error with that. Does anyone have a solution for me? Greetz, Mischa :sign0104:
Erel B4X founder Staff member Licensed User Longtime User Dec 21, 2011 #2 What is the error message? Upvote 0
W winelover Member Licensed User Longtime User Dec 23, 2011 #3 Sorry for the late reply. This is the error I get: Compiling generated Java code. Error B4A line: 85 If Buffer <> Null Then javac 1.6.0_26 src\android\terahosting\winedroid\mywines.java:475: incomparable types: byte[] and double if (_buffer!=(double)(BA.ObjectToNumber(anywheresoftware.b4a.keywords.Common.Null))) { ^ 1 error It happens in this code: Code: Copy Dim Buffer() As Byte Dim InputStream1 As InputStream Buffer = Cursor1.GetBlob("image") If Buffer <> Null Then InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length) bmpWijn.Initialize2(InputStream1) InputStream1.Close End If I want to check whether an image is saved in the database. If so, show the image. If not, show a standard message. How should I check this? Greetz, Mischa Upvote 0
Sorry for the late reply. This is the error I get: Compiling generated Java code. Error B4A line: 85 If Buffer <> Null Then javac 1.6.0_26 src\android\terahosting\winedroid\mywines.java:475: incomparable types: byte[] and double if (_buffer!=(double)(BA.ObjectToNumber(anywheresoftware.b4a.keywords.Common.Null))) { ^ 1 error It happens in this code: Code: Copy Dim Buffer() As Byte Dim InputStream1 As InputStream Buffer = Cursor1.GetBlob("image") If Buffer <> Null Then InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length) bmpWijn.Initialize2(InputStream1) InputStream1.Close End If I want to check whether an image is saved in the database. If so, show the image. If not, show a standard message. How should I check this? Greetz, Mischa
Erel B4X founder Staff member Licensed User Longtime User Dec 25, 2011 #4 This is a bug. It is fixed for the next update. For now you can modify your query and only select records where image is not null. Upvote 0
This is a bug. It is fixed for the next update. For now you can modify your query and only select records where image is not null.