Saving RichViewEdit content in BLOB field using BDE
Posted: Thu Nov 05, 2009 4:48 pm
I am using C++ Builder 2009 and have problems saving RichViewEdit into the BLOB field into local paradox table.
Here is the relevant part of my code:
DataModule1->Query1->SQL->Add("INSERT INTO rvftable (id,rvfcontent) ");
DataModule1->Query1->SQL->Add(" VALUES (:id,:rvfcontent)");
DataModule1->Query1->ParamByName("id")->AsInteger = pacid;
TMemoryStream* stream = (new TMemoryStream);
RichViewEdit1->SaveRVFToStream(Stream, false);
DataModule1->Query1->Params->ParamByName("rvfconten")->SetBlobData(stream->Memory,stream->Size);
DataModule1->Query1->ExecSQL();
DataModule1->Query1->Close();
delete stream;
The result in the blob table shows only set of question marks: "????????????????????????"
When I save the stream to the file it shows something different.
Thus I have a question: How to properly save (and read) content of RichEditView using BDE TQuery (not TTable) component ?
Here is the relevant part of my code:
DataModule1->Query1->SQL->Add("INSERT INTO rvftable (id,rvfcontent) ");
DataModule1->Query1->SQL->Add(" VALUES (:id,:rvfcontent)");
DataModule1->Query1->ParamByName("id")->AsInteger = pacid;
TMemoryStream* stream = (new TMemoryStream);
RichViewEdit1->SaveRVFToStream(Stream, false);
DataModule1->Query1->Params->ParamByName("rvfconten")->SetBlobData(stream->Memory,stream->Size);
DataModule1->Query1->ExecSQL();
DataModule1->Query1->Close();
delete stream;
The result in the blob table shows only set of question marks: "????????????????????????"
When I save the stream to the file it shows something different.
Thus I have a question: How to properly save (and read) content of RichEditView using BDE TQuery (not TTable) component ?