代码如下:
AdoNS::_CommandPtr pCommand;
pCommand.CreateInstance("ADODB.Command");
pCommand->ActiveConnection = m_pConnection; AdoNS::_ParameterPtr param = pCommand->CreateParameter( _bstr_t(""), AdoNS::adChar, AdoNS::adParamInput, 200, _bstr_t(""));
param->Value = "海外兵团";
pCommand->Parameters->Append(param);// 添加参数
pCommand->CommandText = "SELECT count(*) AS num FROM mv_SoftInfo WHERE SoftName = ?";// 返回重复记录数量AdoNS::_RecordsetPtr pRecordset; pRecordset = pCommand->Execute(&vNULL, &vNULL, AdoNS::adCmdText);// 执行命令
int c = int(pRecordset->Fields->GetItem(_variant_t("num"))->Value);

pRecordset = pCommand->Execute(&vNULL, &vNULL, AdoNS::adCmdText);// 执行命令
int d = int(pRecordset->Fields->GetItem(_variant_t("num"))->Value);为什么c = 3,d = 0它们不相同呢???