Re: Reading jpeg binaries from mysql-db



Ok, have done it now with a dataset component and Locate function.
This seems to work without the error "Different types for field 'fileblob';
expecting: Blob"


"Thomas Wormser" <thworms@xxxxxxx> schrieb im Newsbeitrag
news:44e983bf@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,

meanwhile I can store jpeg's and bitmap's data in mysql longblob
fiedltype.
Reading from this field over blobstream does work correctly.
The only curious thing comes up when I want to open the dataset.
In some cases I get an error like this:
"querybinaries: Different types for field 'fileblob'; expecting: Blob,
found: Varbytes"

My code for openinfg the dataset looks like this:

with Data.queryBinaries do
Close;
SQL.Clear;
SQL.Add('select id,source,fileblob,thumb from binaries where
id=:GetIds');
Parameters[0].Value := id;
Open;
end;

This error comes directly after the open statement.

The field "fileblob" is actually defined as longblob in mysql . Delphi 7
has mapped it
as fieldtype "ftBlob" in field definition.

But I get this error only sometimes.
What's going wrong here ?

cu,
Thomas Wormser



.