sql语句是不是有长度限制!
xuin 2002-10-31 05:49:43
为什么我的SQL语句超过500字符就会执行出错~1 !
另外我用COleDateTime控件产生的时间,要在查询条件中引入这个时间,
应该怎么做?
是把这个时间转换成字符串来处理的吗?
还是其他的什么方法!
我的方法是:
Coledatetime dt1,dt2,dttemp;
dttemp=COleDateTime::GetCurrentTime()
dt1.Setdate(dttemp.getyear()-20, dttemp.getmonth(), dttemp.getday());
dt2.Setdate(dttemp.getyear()-10, dttemp.getmonth(), dttemp.getday());
CString strtemp;
strtemp.format("select * from table where [date] between \'%s\' and \'%s\'",
dt1.format(***DATEONLY), dt2.format(***DATEONLY));
***处的具体字符记不清了,反正就是转换成字符串的时候只转换日期,
然后将strTemp作为SQL语句去执行却不能通过!
往高手不另赐教!