Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Needs help on C++ Builder Blob issue

22 views
Skip to first unread message

M.E

unread,
Oct 3, 2006, 11:35:22 AM10/3/06
to
Hi Guru,
I've been working on this code to implement blob
(insert,update,delete blob e.g word document). I keep
getting error to put word document into Oracle 10g
database. I've been trying few examples on the net but
none of it seems to work. Like below when i click the
button, it keep giving error "First chance exception
at $7C812A5B. Exception class EAccessViolation with
message 'Access violation at address 5230885A in
module 'dbrtl100.bpl'. Read of address 00000000'.
Process CgOpr.exe (1092)". Do u have any idea ? Thanks
for you help in advanced

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();
}

0 new messages