|
Rama Krishna wrote:
Did you try dumping the Command.CommandText property or rs.Source to Debug log and running it using SQL*Plus.
Yes, I did that and it all worked fine in SQL+, that was a big part of my confusion.
Rama Krishna wrote:
It may be happening that while constructing the query something may have comeup like quotes which oracle doesnot like.
I streamed the query to a file, and when put direct into SQL+ or a bootstrap we wrote, it works fine.
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
|
|
|
|
|
If you have not already solved it. I did find one thing strange. If you run the exe from a network share or for that matter any compnent comes from a Network Share, I have seen this error occur. It took me 3 days to track this problem.
|
|
|
|
|
Can you post the ADO code. I've had a lot of bother with Oracle and ADO so I might be able to spot something.
What version of Oracle client and MDAC do you have installed?
Michael
"Eureka" is Greek for "This bath is too hot"
|
|
|
|
|
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
|
|
|
|
|
How do I create a command button that brings up a menu like the windows start button? I have been trying to do this for some time now with no success.
|
|
|
|
|
When the button is clicked, use the TrackPopupMenu API to make the menu that you want to appear. This is the same function that you use if you want to create a right-click or context menu.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I've written a Win32 Dialog App that calls CreateDialog instead of CreateWindow. When it starts up I wanted to use FindWindow along with a class name to see if the app was already running. To do this I need a unique ClassName, but the class is created by the call to CreateDialog.
I have tried using the CLASS statement in the resource file, but then the call to CreateDialog fails.
The API documentation for DefDialogProc hints that RegisterClass can be used to set the ClassName for a Dialog. It further states that GetClassName can be used to get the WNDCLASS for a dialog, then the name can be changed and a new class registered.
I think this is standard Win32 stuff, but in case it matters, I'm working with WinCE.
Has anyone ever done this? Nothing works as expected for me. Is a different approach called for? Suggestions? Comments?
Brad Manske
|
|
|
|
|
A better way to limit multiple instances of the app is to create a named mutex. Only one app will be able to do this at a time. If the mutex already exists then you can assume that your program is alreay running, the same way you would if the window was already found.
There are some gotchas to both methods so look at this article.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
While your solution will work,I have one additional requirement that I left unstated.
Once you know that an instance of the app is running, it needs to be brought to the front of the Z-order before the current instance exits. FindWindow returns a handle to the window that you can use to do this.
FindWindow can also search by window Title and this is the solution I may go with but then you have the limitation of not being able to change the window text which is often done on the main window to convey info like the name of the open file.
Can you add any other thoughts? I'm writing this for an article for CodeProject and this has nothing to do with the main topic but I would like to make it clean before submitting it.
Brad Manske
|
|
|
|
|
I have an ActiveX control written using VC++ which is used to process a data file to generate a desired output.
This processing can sometimes takes a very long time, and I want to be able to cancel the processing part of the way through if I wish.
What is the best way to do this?
Cheers
|
|
|
|
|
You will need to have a second thread send a message or set a variable on the thread that has the long process. The thread that is running the long process should periodically check for the message to stop or check the variable that indicates that it should stop.
A good type of variable to use would be an Event. These can be given names and shared across processes if that is what your ActiveX control needs to do.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
PLEASE help!!! I am almost finished with this card game that I'm making, but after I had made a minor change I got a weird error that I can't make go away:
CVTRES : fatal error CVT1103: cannot read file
.\Debug\Pyramids.res : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
Error executing link.exe.
What can I do? Thank you SO much for your help,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
This may sound weird but on occasion, I have gotten the exact same erorr messages. Try rebuilding the entire project and see if it goes away. It usually works for me!
|
|
|
|
|
|
Whew... the rebuild all did it!
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
How do I enable controls when doing OLE embedding? I am trying to call MSWord and MSExcel and several of the buttons on the toolbars are grayed out. And I can only get one layout, the "print layout", I would like to select Normal under View menu option but it is grayed out as well. I didn't disable these controls, how did they get disabled? How can I enable them?;)
|
|
|
|
|
I have made a function to replace every occurence of a substring in a string with a new string. But if i put it in another function, then when that other function is done, an unhandled exception error appears. It's not my function performing an unhandled exception, it's the other function that does it when it's done, but only if i use the stringreplace function in that function:
Unhandled exception in app.exe: 0xC0000005: Access Violation.
here's the function:
void ReplaceString(char *target, const char *toreplace, const char *replacewith)
{
if ((!strcmp(target, "")) || (!strcmp(toreplace, "")) || (!strcmp(replacewith, "")))
return;
char *pos = strstr(target, toreplace);
int currentpos = pos-target;
char *after = new char[strlen(target)-1];
while (pos)
{
currentpos = pos-target;
strcpy(after, pos+strlen(toreplace));
strcpy(&target[currentpos], replacewith);
strcat(target, after);
pos = strstr(&target[currentpos+strlen(replacewith)], toreplace);
}
delete after;
}
Thanks in advance.
|
|
|
|
|
Check with the delete stuff if ure deleting the same area twice and make sure ure not passing somewhere out of bounds
Papa
Murex Co.
|
|
|
|
|
Always use the matching operator delete function
Check the line "delete after;". Anything strikes you as odd? Maybe if you look at how it's allocated? It should be delete[] after;
|
|
|
|
|
1. delete [] after (already mentioned)
2. after is too short. The -1 doesn't allow for the 0.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
when i write delete[] after, it does the same. and after should be one char smaller than target cause it is only supposed to hold the chars after the char to be found, fx
target = "ckndsfkndfksndf"
find = "c"
after = "kndsfkndfksndf"
|
|
|
|
|
But strcpy needs the 0 at the end of the string.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
As others have said, use delete[].
Also (unless I'm half asleep), you are not allocating enough space for the string (you are using strcpy which will copy the ending NULL). You need to allocate strlen(target), not strlen(target)-1.
|
|
|
|
|
See, Matt agrees with me.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
My scrollbars are gone. I am trying to do some embedding/automating with Word. When I do the _Application app and app.SetDisplayScrollBars(TRUE), they only appear for a couple of seconds, then the OnDraw function is performed and they are gone. What did I do wrong? It looks like when windows is sizing my document, it is losing the scrollbars. What is happening? How can I fix it? PLEASE HELP!!!!!
|
|
|
|
|