how can i send string type parameter to Stored Procedure ?

Hello everyone.

How can i send string type (char* type) parameter to Stored Procedure ?
I am using Visual C++ so i tried like that..
VARIANT vtName;
VariantInit(&vtName);
vtName.vt = VT_LPSTR;
char strData[20];
strcpy(strData ,"Simple15");
vtName.pcVal = strData;
pParam = pCommand->CreateParameter("strName", adVarChar, adParamInput, sizeof(strData), vtName);
pCommand->Parameters->Append(pParam);

then always has error on calling CreateParameter().
the error message is 'variable type was different'.

so I tried another way. I tried VT_BSTR type again. then calling CreateParameter() was ok, but the data on the DB table was broken.

can anybody help me to solve this problem ?
thank you.
[788 byte] By [simpleman] at [2007-11-18 23:40:29]