|
-
March 11th, 2003, 08:01 AM
#1
I get problem with execute storedprocedure by ADO.
Error occur on line
hr=pCommand->Execute(NULL,NULL,adCmdStoredProc);//
I dont know what is the matter.
thanks you so much
HRESULT hr;
::_ConnectionPtr pConnection;
::_CommandPtr pCommand;
// ::_ParameterPtr pParameter;
pConnection.CreateInstance(__uuidof(Connection));
pCommand.CreateInstance(__uuidof(Command));
pConnection->Open("driver={SQL Server};server=caihui;database=assistent","clientsetup","02140214",adConnectUnspecified);
pCommand->CommandText="{call ?=sp_clientSetup(?,?,?,?)}";
pCommand->Parameters->Append(pCommand->CreateParameter("strUnit",adChar,adParamInput,9,_variant_t(m_strUnit)));
pCommand->Parameters->Append(pCommand->CreateParameter("strMAC",adChar,adParamInput,12,_variant_t(m_strMAC)));
pCommand->Parameters->Append(pCommand->CreateParameter("strPassword",adVarChar,adParamInput,16,_variant_t(m_strPassword)));
pCommand->Parameters->Append(pCommand->CreateParameter("strNewPassword",adVarChar,adParamInput,16,_variant_t(m_strNewPassword)));
// short iSize=0;
pCommand->Parameters->Append(pCommand->CreateParameter("RETURN_VALUE",adInteger,adParamReturnValue,sizeof(int),_variant_t(short(0))));
pCommand->ActiveConnection=pConnection;
// _bstr_t str=((_bstr_t)pCommand->Parameters->Item["@strUnit"]->Value);
try
{
hr=pCommand->Execute(NULL,NULL,adCmdStoredProc);//;0,pCommand->GetParameters(),adCmdStoredProc)))
}
-
March 11th, 2003, 08:56 AM
#2
Can you specify the error?
Regards,
Emanuel Vaduva
-
March 13th, 2003, 12:58 AM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|