首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

SQL查询出错,请指点,该怎么解决

2012-02-22 
SQL查询出错,,请指点rs3.Open select * from sky_user where username & user_name, Conn3, 1, 3rs3(

SQL查询出错,,请指点
rs3.Open "select * from sky_user where username =" & user_name, Conn3, 1, 3
rs3("ErrLond") = "Over"
rs3.Update
rs3.Close


提示错误“至少有一个未被指定值”


[解决办法]
rs3.Open "select * from sky_user where username =" & user_name &"", Conn3, 1, 3
if rs3.recordcount>0 then 
rs3("ErrLond") = "Over" 
rs3.Update 
end if
rs3.Close 

[解决办法]
'username为字符型,则这样:
rs3.Open "select * from sky_user where username ='" & user_name &"'", Conn3, 1, 3 
if rs3.recordcount>0 then 
rs3("ErrLond") = "Over" 
rs3.Update 
end if 
rs3.Close
[解决办法]
rs3.Open "select * from sky_user where username ='" & user_name & "'", Conn3, 1, 3 

[解决办法]

VB code
rs3.Open "select * from sky_user where username='" & user_name & "'", Conn3, 1, 3 

热点排行