语法错误 (操作符丢失) 在查询表达式 'd_number=' 中
代码如下:<!--#includefile="conn.asp"--><%dimd_number,d_name,adress,phoned_number=trim(req...
代码如下:
<!--#include file="conn.asp"-->
<%
dim d_number, d_name, adress, phone
d_number=trim(request("d_number"))
d_name=trim(request("d_name"))
adress=trim(request("adress"))
phone=trim(request("phone"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from dept where d_number="&d_number
rs.open sql, conn,1,3
%>
<%
if not rs.eof then
rs("d_name")=d_name
rs("adress")=adress
rs("phone")=phone
rs.update
rs.close
set rs=nothing
response.write "<script language='javascript'>window.confirm('该部门成功修改')</script>"
response.Redirect"dept_manege.asp"
else
response.Write"改部门不存在"
response.End
end if
%> 展开
<!--#include file="conn.asp"-->
<%
dim d_number, d_name, adress, phone
d_number=trim(request("d_number"))
d_name=trim(request("d_name"))
adress=trim(request("adress"))
phone=trim(request("phone"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from dept where d_number="&d_number
rs.open sql, conn,1,3
%>
<%
if not rs.eof then
rs("d_name")=d_name
rs("adress")=adress
rs("phone")=phone
rs.update
rs.close
set rs=nothing
response.write "<script language='javascript'>window.confirm('该部门成功修改')</script>"
response.Redirect"dept_manege.asp"
else
response.Write"改部门不存在"
response.End
end if
%> 展开
1个回答
2014-03-15
展开全部
sql="select * from dept where d_number="&d_number
改成
sql="select * from dept where d_number='&+d_number+&'"
我记得大概是这样,SQL语句里用变量的格式。你再仔细查查就知道了。
改成
sql="select * from dept where d_number='&+d_number+&'"
我记得大概是这样,SQL语句里用变量的格式。你再仔细查查就知道了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询