关于SQL查询语句,我用VB+Access

CatchFish 2003-03-31 08:38:01
rs.Source = "select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = -1166237008"没问题,可是如果


dim iBH as long
iBH=-1166237008
rs.Source = "select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = long"就不对呢?提示"No value given for one or more required parameters"

我如果改成
dim iBH as long
iBH=-1166237008
rs.Source = "select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = 'long'"还是不对?提示"标准表达式中数据类型不匹配"

我要怎么办,请高手解救!
...全文
14 点赞 收藏 10
写回复
10 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
wxy001 2003-04-01
你自己看看哪里有问题,不就的了
long是什么?iBH又是什么?何必要那么多人说呢
回复
watt 2003-04-01
"select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = "& iBH
回复
xie7809 2003-04-01
rs.Source = "select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = " & iBH
也行
回复
xysophie 2003-04-01
rs.Source = "select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = " & iBH
回复
饮水需思源 2003-04-01
rs.Source = "select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = " & iBH & ""
回复
980 2003-04-01
rs.Source = "select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = " & cstr(iBH)
donglw(天行) 没问题
回复
s6w6k 2003-04-01
rs.Source = "select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = ' & iBH & '
也行
回复
Wang_xiaoni 2003-04-01
donglw(天行) 正确
回复
donglw 2003-04-01
rs.Source = "select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = " & cstr(iBH)
回复
Virus2003 2003-03-31
rs.Source = "select shuliang,wuzibh from CaiJuLeiWuZi where wuzibh = '"iBH"'"
回复
相关推荐
发帖

1187

社区成员

VB 数据库(包含打印,安装,报表)
申请成为版主
帖子事件
创建了帖子
2003-03-31 08:38
社区公告
暂无公告