语法错误 (操作符丢失) 在查询表达式 'id =' 中。
我的代码:<%OptionExplicitdimconn,DBPath,sql,rs,iddimyijian,zhuban,fenban,xieban,shneirong...
我的代码:
<%
Option Explicit
dim conn,DBPath,sql,rs,id
dim yijian,zhuban,fenban,xieban,shneirong,jianyi,bianhao,time,name,address,tel,youbian,title,neirong
id=request("id")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("../../Foosun_Data/ti-an.mdb")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from wai where id ="&request.form("id")
rs.open sql,conn
rs("yijian") =Request.Form("yijian")
rs("zhuban") =Request.Form("zhuban")
rs("fenban") =Request.Form("fenban")
rs("xieban") =Request.Form("xieban")
rs("bianhao") =Request.Form("bianhao")
rs("shneirong") =Request.Form("shneirong")
rs("jianyi") =Request.Form("jianyi")
rs("time") =now
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "shenhe.asp"
%>
错的是:”rs.open sql,conn“这行 展开
<%
Option Explicit
dim conn,DBPath,sql,rs,id
dim yijian,zhuban,fenban,xieban,shneirong,jianyi,bianhao,time,name,address,tel,youbian,title,neirong
id=request("id")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("../../Foosun_Data/ti-an.mdb")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from wai where id ="&request.form("id")
rs.open sql,conn
rs("yijian") =Request.Form("yijian")
rs("zhuban") =Request.Form("zhuban")
rs("fenban") =Request.Form("fenban")
rs("xieban") =Request.Form("xieban")
rs("bianhao") =Request.Form("bianhao")
rs("shneirong") =Request.Form("shneirong")
rs("jianyi") =Request.Form("jianyi")
rs("time") =now
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "shenhe.asp"
%>
错的是:”rs.open sql,conn“这行 展开
3个回答
展开全部
其实真正错的是这行:sql="select * from wai where id ="&request.form("id")
你确认你的ID字段是数字型吗?如果不是,请加上单引号对
你确认你的ID字段是数字型吗?如果不是,请加上单引号对
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
request.form("id")没取到数是NULL
改成
sql="select * from wai where id ='"&request.form("id") &"'"
改成
sql="select * from wai where id ='"&request.form("id") &"'"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询