关于常数变量的问题
我定义了'以下为单据状态
const bsCancel=-1
const bsFinished=6
然后写sql语句时候用
sql="select * from "&table&" where "&costomer&"='"&session("user")&"'"
sql=sql&" and "&thestate&"<>bsFinished and "&thestate&"<>bsCancel order by "&thedate
rs.open sql,conn,1
出现类型不一直的错误,如果写成
sql=sql&" and "&thestate&"<>6 and "&thestate&"<>-1 order by "&thedate
那就不会错.
thestate是int的.
问题点数:20、回复次数:4Top
1 楼AntinomyArt(.)回复于 2005-04-01 12:00:56 得分 2
CInt()Top
2 楼lstup(流水)回复于 2005-04-01 12:02:07 得分 2
结构太乱/
看花了Top
3 楼lstup(流水)回复于 2005-04-01 12:03:22 得分 2
接过来的数据是什么类型,如果不是数值型,还是转一下先吧。
CINT,或者CLNGTop
4 楼madpolice(午夜狂龙)回复于 2005-04-01 12:07:11 得分 14
sql=sql&" and "&thestate&"<>"&bsFinished&" and "&thestate&"<>"&bsCancel&" order by "&thedateTop




