Page 1 of 1

sqlite3 reading blob with delphi

Posted: 27.05.2008, 11:29
by gev
Hi
i hav ea problem, if i wont to read the blob field i get only the first byte and the size of stream is olso 1 insted of 40.
Hier is the code
var blob : TStream;
Begin
blob := zeostable.CreateBlobStream(zeostable.FieldByName('data'), bmRead);
showmessage(inttostr(blob.Size));
end;

becouse of this i decided to dump the field and read from a file, so reading from the file is working but i can't dump to file becouse the same problem, i get only the first byte of the field.

hier is the second code
var filestr : TFileStream;
begin
filestr := TFileStream.Create('C:\hehe',fmCreate);
blob := zeostable.CreateBlobStream(zeostable.FieldByName('data'), bmRead);
showmessage(inttostr(blob.Size));
filestr.CopyFrom(blob,blob.Size);
end;

hier is the size again 1;
can some1 help me plz.
thanks

Posted: 27.05.2008, 13:44
by gev
Its a bug in ZeosDB, i switch to ather components and with the same code its working perfect.