CodePudding user response:
Database field with TBlob typeCodePudding user response:
Any file can save in binary stream to BlobField fields,CodePudding user response:
//insert
Void __fastcall TfrmMain: : btn11Click (TObject * Sender)
{
TMemoryStream * pMS=new TMemoryStream;
Qry1 - & gt; Close ();
Qry1 - & gt; SQL - & gt; The Clear ();
String SQL="insert into information (text) values (: text)";
Qry1 - & gt; SQL - & gt; Add (SQL);
Mmo1 - & gt; Lines - & gt; SaveToStream (pMS);
PMS - & gt; The Position=0;
Qry1 - & gt; The Parameters - & gt; ParamByName (" text ") - & gt; LoadFromStream (pMS, ftBlob);
Qry1 - & gt; ExecSQL ();
Qry1 - & gt; Close ();
Delete the pMS.
}
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
CodePudding user response:
Refer to the right, ha hahttp://blog.csdn.net/xjq2003/article/details/3898634