Page 1 of 1

Blob files

Posted: Wed 25 May 2011 12:05
by jwake
:cry: I am using MySQL 5.90.0.54 for Ras Studio 2007. Very frustrated that I have not been able to write/read a *.bitmap or *.jpeg from a database BLOB field.

I have tried tried loading a TFileStream and loading the file with a dynamic_cast and get a syntax error. I I have tried several methods using Streams, Bitmap, etc.

Does this verion of MySql support writing Blobs?

If so, can you supply an example I can test

Posted: Wed 25 May 2011 14:13
by AndreyZ
Hello,

Please try using the following code:

Code: Select all

void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
  MyQuery->Open();	
  MyQuery->Append();
  static_cast(MyQuery->FieldByName("blobfieldname"))->LoadFromFile("filename");
  MyQuery->Post();
}
Does it work for you? If not, please specify the exact version of MySQL server you are using.