Reading jpeg binaries from mysql-db



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


.



Relevant Pages

  • Re: Two threads reading from same file?
    ... Each thread needs to open its own stream, Move the open statement to the ... This is ok if you are just opening and reading the file. ... int buffer; ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Two threads reading from same file?
    ... Each thread needs to open its own stream, Move the open statement to the ... This is ok if you are just opening and reading the file. ... > around the fread() call ... ... > put mutex locks around the fseek() and freadcalls. ...
    (microsoft.public.win32.programmer.kernel)