asp修改问题

来源:百度知道 编辑:UC知道 时间:2024/06/02 09:14:30
求助
错误类型:
Microsoft JET Database Engine (0x80040E07)
标准表达式中数据类型不匹配。
/shenqun/xg3.asp, 第 23 行
<%
if session("admin")="" then
response.redirect "index.asp"
else
if session("flag")>2 then
response.write "<br><p align=center>您没有操作的权限</p>"
response.end
end if
end if

%>
<%
Dim gpx
gpx = "1"
If (Request("gp123") <> "") Then
gpx = Request("gp123")
End If
%>
<%
exec= "SELECT * FROM dt2 WHERE gp123 = " + gpx
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<%
While NOT rs.EOF
%>
<body background="images/indexbg.gif">

<form method="POST" action="xg12.asp?gp=<%=rs("gp123")%>">
&

exec= "SELECT * FROM dt2 WHERE gp123 = " + gpx
应该是这句的问题
检查一下gpx和gp123的类型,它们可能不匹配
按你上面的代码,gpx应该是string型,你的数据库中字段gp123是什么数据类型?
如果是int型的就必须把gpx转换为int型,用cint函数转换