passing a string parameter in ADO command 
Author Message
 passing a string parameter in ADO command

I was doing the following code, I tried to excute a stored
procedure with an input string in ADO. when I do the
execute, the error comes out. I don't know why. If I set
everything with an integer, then it works fine. I suspect
I did something wrong with the string. Could anybody help
me this? Thank you.

        TCHAR buf[size];
.....
.....
        VARIANT vtXMLDoc;
        vtXMLDoc.vt = VT_BSTR;
        CComBSTR bstrTmp(buf);
        vtXMLDoc.bstrVal = (BSTR)bstrTmp;

        TESTHR(pPrm.CreateInstance(__uuidof(Parameter)));
        pPrm->Type = adWChar;
        pPrm->Size = bufsize;
        pPrm->Direction = adParamInput;
        pPrm->Value  = vtXMLDoc;
        pCmd->Parameters->Append(pPrm);

        pRst = pCmd->Execute(NULL,NULL,adCmdStoredProc);



Mon, 09 Feb 2004 06:27:40 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. How to pass multi parameters in ado command parameter

2. Passing empty string as command parameter

3. trying to pass output parameter from stored procedure to ADO command

4. Problem passing ADO command objects as parameters in MTS

5. 2nd Request - Passing parameters to ADO Data Environment command

6. How do you Pass empty strings as Parameters in ADO

7. Passing custom COM Object as an ADO Command parameter

8. How do you Pass empty strings as Parameters in ADO

9. Pass ADO/ADO.NET parameter arrays for batch insert/update

10. pass varchar string into exec command

11. Can parameters be passed to T-SQL command

12. trying to pass return value to adodb.command.parameters


 
Powered by phpBB® Forum Software