sql语句的问题
ohfox 2005-09-25 12:59:19 strSQL.Format("select * from history where ID=%s",m_ctrList.GetItemText(i,0));
和
strSQL.Format("select * from history where ID='%s' ",m_ctrList.GetItemText(i,0));
这2种情况在编译的时候都能够正常通过
可是运行时候,第一种情况是数据库“语法错误,在查询表达式 ‘ID='中”
第二种情况是“标准表达式中数据类型不匹配”
这我就郁闷了,应该第二种写法是正确的阿,也都是CString类型,怎么不匹配呢? 第一种语法 上不对,怎么通过编译的呢?