ADO访问技术 在登陆对话框中使用_RecordsetPtr和 _ConnectionPtr没有出现异常可是在添加图书中使用却出现异常,两者的代码几乎是完全一样的除了sql外。请问这是为什么?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以呀在登陆空中访问用户名表是这样:CString str; str="select * from Mg where 用户名='"+m_user+"' and "; str=str+"密码='"+m_pass+"'"; CPJApp *theApp=(CPJApp *)AfxGetApp(); theApp->pRecordset=theApp->pConnection->Execute((_bstr_t)str,NULL,adCmdText);这没有什么问题 但不调试也可以在图书表中点击添加图书按钮是这样:CString str; str="select * from Reader where 图书编号='"+m_booknumber+"'"; CPJApp *theApp=(CPJApp *)AfxGetApp(); theApp->pRecordset=theApp->pConnection->Execute((_bstr_t)str,NULL,adCmdText);//检查图示编号是否存在当再次执行时不能了 产生异常 产生的异常是IDispatch #error对话框 你的sql有问题,sql.Format=("select * from Mg where 用户名='%s' and 密码='%s',m_user,m_pass"); 你的sql有问题,sql.Format=("select * from Mg where 用户名='%s' and 密码='%s'",m_user,m_pass); 用这个,或者用[]将变量名括起来也行 兄弟str语句完全正确!!! 带checkbox的clistbox,判断如何选中 金山的隐私保护器核心开源代码—求解 请教问题,请解答 在vc中是否有把双精度数转化为文本形式?(输入到编辑框控件中?) 如何清除上次绘图在picture里画的线。。。。。 串口用XON/XOFF流控制的问题? 多线程的问题 ExecuteSQL(_T("RENAME TABLE table1 TO table2"))出现异常? 怎样才能知道电脑已经连上了internet VBScript调用ATL控件的事件 更换不了installshield做的程序的卸载快捷方式的图标? 如何在vc++6.0中编写一个计时器程序
在登陆空中访问用户名表是这样:
CString str;
str="select * from Mg where 用户名='"+m_user+"' and ";
str=str+"密码='"+m_pass+"'";
CPJApp *theApp=(CPJApp *)AfxGetApp();
theApp->pRecordset=theApp->pConnection->Execute((_bstr_t)str,NULL,adCmdText);
这没有什么问题 但不调试也可以
在图书表中点击添加图书按钮是这样:
CString str;
str="select * from Reader where 图书编号='"+m_booknumber+"'";
CPJApp *theApp=(CPJApp *)AfxGetApp();
theApp->pRecordset=theApp->pConnection->Execute((_bstr_t)str,NULL,adCmdText);//检查图示编号是否存在
当再次执行时不能了 产生异常