在对应所需名称或序数的集合中 未找到项目

e_zhiwen 2010-07-13 09:53:42
各位大哥,看下下面的东西


sqlstr="select [MachineID] from [MachineList] where [MachineID]='"&machineid&"'"
response.write sqlstr
rs.open sqlstr,conn,1,1
response.write err.description
if err or machineid="" or rs.recordcount>0 then
response.write "<script language='javascript'>alert('Found the Error or Duplicate record,Check MachineID Fill and error :"&err.description&"');history.go(-1);</script>"
response.end
end if
rs.close

sqlstr="select machinesn from [machinelist] where machinesn='"&machinesn&"'"
rs.open sqlstr,conn,1,1
if err or machinesn="" or rs.recordcount>0 then
response.write "<script language='javascript'>alert('Found the Error or Duplicate record,Check MachineSN Fill and error :"&err.description&"');history.go(-1);</script>"
response.end
end if
rs.close


这二段查找是否重复的代码总报标题的错误,但把sqlstr放到SQL中执行就不会出错。想不明白。有没有高手解答下。看了N久没看出来是什么问题。
...全文
164 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lbcleo 2010-07-14
  • 打赏
  • 举报
回复
response.write sqlstr
rs.open sqlstr,conn,1,1
response.write err.description
e_zhiwen 2010-07-14
  • 打赏
  • 举报
回复
shit,是上个语句造成的,不是这里,哎发现了错误在哪了。
e_zhiwen 2010-07-13
  • 打赏
  • 举报
回复
sqlstr 中的select machineid from machinelist where machineid='test' 这个语句放在SQL中执行没有报错。这能不能说明,语句中的字段 没有打错呢?
叫我梁大侠 2010-07-13
  • 打赏
  • 举报
回复
你看你的这条语句查询的字段名 MachineID
和数据库表格中的字段名是否一样哦

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧