No blob?

winelover

Member
Licensed User
Longtime User
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:
 

winelover

Member
Licensed User
Longtime User
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:
B4X:
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
Top