Click here to Skip to main content
16,006,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralOracle/ADO HELL Pin
Christian Graus14-Jun-02 16:40
protectorChristian Graus14-Jun-02 16:40 
GeneralRe: Oracle/ADO HELL Pin
Rama Krishna Vavilala14-Jun-02 17:13
Rama Krishna Vavilala14-Jun-02 17:13 
GeneralRe: Oracle/ADO HELL Pin
Christian Graus14-Jun-02 17:19
protectorChristian Graus14-Jun-02 17:19 
GeneralRe: Oracle/ADO HELL Pin
Rama Krishna Vavilala14-Jun-02 17:58
Rama Krishna Vavilala14-Jun-02 17:58 
GeneralRe: Oracle/ADO HELL Pin
Christian Graus14-Jun-02 18:17
protectorChristian Graus14-Jun-02 18:17 
GeneralRe: Oracle/ADO HELL Pin
Rama Krishna Vavilala15-Jun-02 1:06
Rama Krishna Vavilala15-Jun-02 1:06 
GeneralRe: Oracle/ADO HELL Pin
Michael P Butler14-Jun-02 22:46
Michael P Butler14-Jun-02 22:46 
GeneralRe: Oracle/ADO HELL Pin
Christian Graus16-Jun-02 11:59
protectorChristian Graus16-Jun-02 11:59 
Thanks - I am at work again and so able to post it...

_variant_t vRecordsAffected;
_variant_t vtParams = vtMissing;

m_pConnection->BeginTrans();

bTransactionStarted = true;

_CommandPtr pcmdInsertBinaryData (__uuidof(Command));
pcmdInsertBinaryData->ActiveConnection = m_pConnection;

/*
ostringstream ss;

ss << "INSERT INTO "
<< "tblAttachmentVersions "
<< " (QFileid, RevisionCount, filename, mimetype) "
<< " VALUES "
<< " ( " << nQFileID << ", " << lDataID << ", '" << b_tFileName << "', '" << b_tMimeType << "' );";

pcmdInsertBinaryData->CommandText = ss.str().c_str();
pcmdInsertBinaryData->CommandType = adCmdText;

pcmdInsertBinaryData->Execute(&vRecordsAffected, &vtParams, adExecuteNoRecords);
//*///

pcmdInsertBinaryData->CommandText = "QFile_InsertAttachment";
pcmdInsertBinaryData->CommandType = adCmdStoredProc;

_ParameterPtr pprmInsert;

pprmInsert = pcmdInsertBinaryData->CreateParameter("QFileID", adInteger, adParamInput, 0, _variant_t(nQFileID, VT_I4));
pcmdInsertBinaryData->Parameters->Append(pprmInsert);

pprmInsert = pcmdInsertBinaryData->CreateParameter("DataID", adInteger, adParamInput, 0, _variant_t(lDataID, VT_I4));
pcmdInsertBinaryData->Parameters->Append(pprmInsert);

pprmInsert = pcmdInsertBinaryData->CreateParameter("FileName", adBSTR, adParamInput, 255, b_tFileName);
pcmdInsertBinaryData->Parameters->Append(pprmInsert);

pprmInsert = pcmdInsertBinaryData->CreateParameter("MimeType", adBSTR, adParamInput, 255, b_tMimeType);
pcmdInsertBinaryData->Parameters->Append(pprmInsert);

pcmdInsertBinaryData->Execute(&vRecordsAffected, &vtMissing, adExecuteNoRecords);

The commented out bit is how I tried it with a command, which gives the afore mentioned error. I've tried all sorts of permutations, with and without the ;, simplified down so the only thing I enter is the primary key, and it always gives an invalid character error. Every thing I have tried, if streamed to a file, works right away in SQL+. The stored procedure hangs indefinately, and it looks like this:

(QFileID IN tblAttachmentVersions.qfileid%TYPE,
DataID IN tblAttachmentVersions.RevisionCount%TYPE,
Filename IN tblAttachmentVersions.filename%TYPE,
MimeType IN tblAttachmentVersions.mimetype%TYPE)
IS
BEGIN

INSERT INTO tblAttachmentVersions
(QFileid, RevisionCount, binaryData, filename, mimetype)
VALUES
(QFileID , DataID , empty_blob(), Filename , MimeType);

END;

Thanks for the help.

Christian

I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
GeneralAttaching menus to command buttons Pin
Richard Otter14-Jun-02 16:21
Richard Otter14-Jun-02 16:21 
GeneralRe: Attaching menus to command buttons Pin
Paul M Watt14-Jun-02 16:38
mentorPaul M Watt14-Jun-02 16:38 
GeneralClassName for a Dialog App Pin
Bradley Manske14-Jun-02 15:04
Bradley Manske14-Jun-02 15:04 
GeneralRe: ClassName for a Dialog App Pin
Paul M Watt14-Jun-02 16:55
mentorPaul M Watt14-Jun-02 16:55 
GeneralRe: ClassName for a Dialog App Pin
15-Jun-02 3:00
suss15-Jun-02 3:00 
QuestionHow do I stop a process before it completes? Pin
smoothchew14-Jun-02 13:55
smoothchew14-Jun-02 13:55 
AnswerRe: How do I stop a process before it completes? Pin
Paul M Watt14-Jun-02 17:00
mentorPaul M Watt14-Jun-02 17:00 
QuestionWhy did I get this "file corrupt or missing" error? Pin
Selevercin14-Jun-02 12:58
Selevercin14-Jun-02 12:58 
AnswerRe: Why did I get this "file corrupt or missing" error? Pin
14-Jun-02 13:01
suss14-Jun-02 13:01 
AnswerRe: Why did I get this "file corrupt or missing" error? Pin
Nish Nishant14-Jun-02 15:27
sitebuilderNish Nishant14-Jun-02 15:27 
GeneralRe: Why did I get this "file corrupt or missing" error? Pin
Selevercin15-Jun-02 14:26
Selevercin15-Jun-02 14:26 
GeneralEnable Controls Pin
14-Jun-02 11:14
suss14-Jun-02 11:14 
GeneralStrange unhandled exception. Pin
redeemer14-Jun-02 10:57
redeemer14-Jun-02 10:57 
GeneralRe: Strange unhandled exception. Pin
14-Jun-02 11:26
suss14-Jun-02 11:26 
GeneralRe: Strange unhandled exception. Pin
Mike Nordell14-Jun-02 11:27
Mike Nordell14-Jun-02 11:27 
GeneralRe: Strange unhandled exception. Pin
Tim Smith14-Jun-02 11:36
Tim Smith14-Jun-02 11:36 
GeneralRe: Strange unhandled exception. Pin
redeemer14-Jun-02 12:05
redeemer14-Jun-02 12:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.