m_pRs->Open("select * from 表 where 字段=变量",.....);
请问高手,如果我的变量int stuno;该如何正确放到“变量的位置”?
在线急等,马上结帖。
请问高手,如果我的变量int stuno;该如何正确放到“变量的位置”?
在线急等,马上结帖。
解决方案 »
- CMFCMenuBar 更新菜单和菜单项的字串
- 怎样查找指定目录下的所有目录?
- 为什么我2003 sdk装不了? 急
- 串口数据转化问题
- 长时间运行,程序变慢了,有些什么原因会导致这种情况,来者有分
- 想做一个VC6.0那样的WorkSpace,谁有这方面的经验或代码?
- "warning LNK4098"如何解决这个警告
- 我的VC无法启动MSDN,在option里面的 help system页中没有显示任何帮助的preffered language 以及 collection
- 如何动态地定义数组?
- 远程桌面实时捕获
- 菜鸟问题,关于ADO的查找变量??(急)
- 我用超级终端将手机上的短信读出来,是Unicode 码,哪位帮我看看?马上结贴.
sql.Format("("select * from 表 where 字段=%d", stuno);
m_pRs->Open(sql,....);
“Runtime Error
abnormal program termination”
str.Format("%d", stuno);
CString sql="select * from 表 where 字段=";
sql += str;
sql.Format("("select * from 表 where 字段=%d", stuno);
m_pRs->Open( (_variant_t)sql,....);
我照你们的做了,还是不行,报错:
Runtime Error
abnormal program termination还问一下,sql.Format("("select * from 表 where 字段=%d", stuno);
此句的"("在此起什么作用?
改为
sql.Format("select * from 表 where 字段=%d", stuno);
照你的做了,报错:
cannot convert from 'class CString' to 'const class _variant_t急呀,到底哪儿出问题了?
m_pRs->Open("select * from 表 where id=\'"+stuno+"\'",);
可以了。