Rgrds
M.E
--------- Code snippet -----------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
WideString SQLstr = (WideString)"select
ddm_id,ddm_title,";
SQLstr += "ddm_date,ddm_file from ";
SQLstr += CommonFunctions->getSchema() + ".CG_DDM";
SQLstr += " Where ddm_id = 2";
//If not connect to Db now!!!!
if (!ADOConnection1->Connected)
{
ADOConnection1->LoginPrompt = false;
ADOConnection1->ConnectionString =
CommonFunctions->defConnStr();
}
ADOConnection1->KeepConnection = true;
ADOQuery1->Prepared = true;
ADOQuery1->SQL->Text = SQLstr;
ADOQuery1->Connection = ADOConnection1;
// ADOQuery1->Active = true;
ADOQuery1->Open();
ADOQuery1->First();
TMemoryStream *ms = new TMemoryStream();
ms->LoadFromFile("c:\\temp\\mydoc.doc");
ms->Seek(0,soFromBeginning);
TBlobField *BlobField = new
TBlobField(ADOQuery1->FieldByName("DDM_FILE"));
ADOQuery1->Edit();
BlobField->LoadFromStream(ms);
ADOQuery1->Post();
ADOQuery1->Free();
ms->Free();
}