BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Needs help on C++ Builder Blob issue

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases
View previous topic :: View next topic  
Author Message
M.E
Guest





PostPosted: Tue Oct 03, 2006 8:35 pm    Post subject: Needs help on C++ Builder Blob issue Reply with quote



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();
}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.