我程序代码如下发生了IDispatch error #3092
bool CFifNumDlg::IsRepeated(int board[][4])
{ _RecordsetPtr rst1;
CString sql="slect * from fifnum where ";
CString sql1,sql2,sql3,sql4;
rst1=rst;
int count;
sql1.Format("i0=%d and i1=%d and i2=%d and i3=%d and ",board[0][0],board[0][1],board[0][2],board[0][3]);
sql2.Format("i4=%d and i5=%d and i6=%d and i7=%d and ",board[1][0],board[1][1],board[1][2],board[1][3]);
sql3.Format("i8=%d and i9=%d and i10=%d and i11=%d and ",board[2][0],board[2][1],board[2][2],board[2][3]);
sql4.Format("i12=%d and i13=%d and i14=%d and i15=%d ",board[3][0],board[3][1],board[3][2],board[3][3]);
sql+=sql1;
sql+=sql2;
sql+=sql3;
sql+=sql4;
try
{
rst->raw_Close();
rst->Open((_bstr_t)sql,conn.GetInterfacePtr(),adOpenDynamic, adLockPessimistic,adCmdText);
count=rst->GetRecordCount();
rst->Close();
rst->Open("select * from fifnum",conn.GetInterfacePtr(),adOpenStatic,adLockOptimistic,adCmdText);//打开就记录集
if(count>0)
return true;
else
return false;
}
catch(_com_error &e)
{
AfxMessageBox(e.ErrorMessage(),0,0);
}
}
bool CFifNumDlg::IsRepeated(int board[][4])
{ _RecordsetPtr rst1;
CString sql="slect * from fifnum where ";
CString sql1,sql2,sql3,sql4;
rst1=rst;
int count;
sql1.Format("i0=%d and i1=%d and i2=%d and i3=%d and ",board[0][0],board[0][1],board[0][2],board[0][3]);
sql2.Format("i4=%d and i5=%d and i6=%d and i7=%d and ",board[1][0],board[1][1],board[1][2],board[1][3]);
sql3.Format("i8=%d and i9=%d and i10=%d and i11=%d and ",board[2][0],board[2][1],board[2][2],board[2][3]);
sql4.Format("i12=%d and i13=%d and i14=%d and i15=%d ",board[3][0],board[3][1],board[3][2],board[3][3]);
sql+=sql1;
sql+=sql2;
sql+=sql3;
sql+=sql4;
try
{
rst->raw_Close();
rst->Open((_bstr_t)sql,conn.GetInterfacePtr(),adOpenDynamic, adLockPessimistic,adCmdText);
count=rst->GetRecordCount();
rst->Close();
rst->Open("select * from fifnum",conn.GetInterfacePtr(),adOpenStatic,adLockOptimistic,adCmdText);//打开就记录集
if(count>0)
return true;
else
return false;
}
catch(_com_error &e)
{
AfxMessageBox(e.ErrorMessage(),0,0);
}
}
解决方案 »
- MFC中怎么用vector????????
- 一个做好的VC2005简单工程如何把类型从“多个文档”改为“基于对话框”?
- 如何在vc代码中创建一个水晶报表rpt文件?
- [请教]如何解决:LNK error:C2440?<给分>{MSDN看了也搞不懂}
- 多文档的类似资源管理器的显示(特急!!)
- VC++ MapX移动地图到指定经纬度,居中并放大
- 怎样让打印机退纸????
- 如何让编辑框只能输入一个字符
- 请教高手:用什么函数可以得到硬盘的分区目录啊,就象资源管理器一样的?
- 高手看过来!-- 怎样在获取某种文件格式的右键菜单?
- 高分求教opencv2.0脱离动态链接库运行方法
- 位图的长,宽等信息怎么获取?
::CoInitialize(NULL);另外,建议楼主重新注册一个帐号,这样才有分给大家,你没分很多人可能不愿来看你的问题的。
是关键字的问题
不过楼主一分都不给?呵呵