计数字段错误的语法错误

时间:2015-05-12 08:05:22

标签: c++ sql-server odbc

过去几天我尝试使用ODBC连接到存储过程。 这是我的CRecordset代码:

sp_insertSesMessageStore::sp_insertSesMessageStore(CDatabase* pdb)
 : CRecordset(pdb){
// Param Init
m_RETURN_VALUE = -1;
m_PROVIDER_IDParam = _T("");
m_BRANCH_IDParam = _T("");
m_ACCOUNTParam = _T("");
m_SES_USER_UNIQUE_IDParam = _T("");
m_DISPLAY_NAMEParam = _T("");
m_SMTP_ADDRESSParam = _T("");
m_MESSAGE_TYPE_IDParam = 0;
m_PRIORITYParam = 0;
m_SUBJECTParam = _T("");
m_SUMMARYParam = _T("");
m_TEMPLATE_IDParam = _T("");
m_BODY_TYPE_IDParam = 0;
m_TRACKING_IDParam = _T("");
m_EXPIRATION_TIMEParam = _T("");
m_SUBCATEGORY_IDParam = 0;
m_FOLDER_IDParam = 0;
m_NUM_ATTACHMENTSParam = 0;
m_ACCESS_IDParam = _T("");
m_FLAGSParam = 0;
m_FAVORITEParam = FALSE;
m_CERTIFIED_IDParam = _T("");
m_SECURE_RESPONSE_OTPParam = _T("");
m_MESSAGE_IDParam = _T("");
m_nParams = 24;

m_nDefaultType = snapshot;}

这是DoDataExchange。

void sp_insertSesMessageStore::DoFieldExchange(CFieldExchange* pFX){
// RFX output param mapping
/*pFX->SetFieldType(CFieldExchange::outputParam);
RFX_Long(pFX, _T("[@RETURN_VALUE]"), m_RETURN_VALUE);*/

// RFX input param mapping
pFX->SetFieldType(CFieldExchange::inputParam);
RFX_Text(pFX, _T("[@PROVIDER_ID]"), m_PROVIDER_IDParam, 3);
RFX_Text(pFX, _T("[@BRANCH_ID]"), m_BRANCH_IDParam, 50);
RFX_Text(pFX, _T("[@ACCOUNT]"), m_ACCOUNTParam, 255);
RFX_Text(pFX, _T("[@SES_USER_UNIQUE_ID]"), m_SES_USER_UNIQUE_IDParam, 8);
RFX_Text(pFX, _T("[@DISPLAY_NAME]"), m_DISPLAY_NAMEParam, 255);
RFX_Text(pFX, _T("[@SMTP_ADDRESS]"), m_SMTP_ADDRESSParam, 255);
RFX_Int(pFX, _T("[@MESSAGE_TYPE_ID]"), m_MESSAGE_TYPE_IDParam);
RFX_Byte(pFX, _T("[@PRIORITY]"), m_PRIORITYParam);
RFX_Text(pFX, _T("[@SUBJECT]"), m_SUBJECTParam, 255);
RFX_Text(pFX, _T("[@SUMMARY]"), m_SUMMARYParam, 255);
RFX_Text(pFX, _T("[@TEMPLATE_ID]"), m_TEMPLATE_IDParam, 255);
RFX_Int(pFX, _T("[@BODY_TYPE_ID]"), m_BODY_TYPE_IDParam);
RFX_Text(pFX, _T("[@TRACKING_ID]"), m_TRACKING_IDParam, 255);
RFX_Text(pFX, _T("[@EXPIRATION_TIME]"), m_EXPIRATION_TIMEParam, 16);
RFX_Int(pFX, _T("[@SUBCATEGORY_ID]"), m_SUBCATEGORY_IDParam);
RFX_Int(pFX, _T("[@FOLDER_ID]"), m_FOLDER_IDParam);
RFX_Int(pFX, _T("[@NUM_ATTACHMENTS]"), m_NUM_ATTACHMENTSParam);
RFX_LongBinary(pFX, _T("[@BODY]"), m_BODYParam);
RFX_Text(pFX, _T("[@ACCESS_ID]"), m_ACCESS_IDParam, 255);
RFX_Long(pFX, _T("[@FLAGS]"), m_FLAGSParam);
RFX_Bool(pFX, _T("[@FAVORITE]"), m_FAVORITEParam);
RFX_Text(pFX, _T("[@CERTIFIED_ID]"), m_CERTIFIED_IDParam, 100);
RFX_Text(pFX, _T("[@SECURE_RESPONSE_OTP]"), m_SECURE_RESPONSE_OTPParam, 50);

// RFX input_output param mapping
pFX->SetFieldType(CFieldExchange::inoutParam);
RFX_Text(pFX, _T("[@MESSAGE_ID]"), m_MESSAGE_IDParam, 8);}

BOOL sp_insertSesMessageStore::ExecDirect(){
return Open(CRecordset::forwardOnly, GetDefaultSQL(), CRecordset::executeDirect);}

这是我传递的声明。

CString sp_insertSesMessageStore::GetDefaultSQL(){
return _T("{CALL sp_insertSesMessageStore (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");}

这是我在网络上找到的工具自动生成的代码。 我已经隔离了问题,这个例外的原因是CLongBinary成员,无法找到问题,有什么建议吗?!

0 个答案:

没有答案