想通过index.asp的表单输入值提交后直接添加进数据文件里,表单有学号和姓名两个项方法为post,action="add.asp",conn.asp的内容为
_<%
constr="DBQ="&server.mappath("xmy.mdb")&";driver={microsoft access driver (*.mdb)}"
set db=server.createobject("adodb.connection")
db.open constr
%>
_
以下为add.asp程序里的内容
<!--#include file="conn.asp"-->
<%
dim strXH,strXM,strCW,strxh,strxm,strbl
strXH="您忘记填写学号,请填写学号。"
strXM="您忘记填写姓名,请填写姓名。"
strCW="出现未知错误"
strxh=trim(request.form("xh"))
strxm=trim(request.form("xm"))
strbl=0
If strxh="" Then
response.Redirect("index.asp?ErrorMessage="&strXH)
strbl=1
End If
If strxm="" Then
response.Redirect("index.asp?ErrorMessage="&strXM)
strbl=1
End If
If strbl=0 Then
set rs=server.createobject("adodb.recordset")
insertsql="select * from sushe"
rs.open insertsql,db,1,3
rs.addnew
rs("xuehao")=strxh
rs("xingming")=strxm
rs.update
rs.close
set rs=nothing
Response.Redirect("xinxi.asp")
Else
Response.Redirect("index.asp?ErrorMessage="&strCW)
End If
%>
add.asp运行错误,不知错在哪里,刚学ASP请各位大佬指教
????????????????????????????
哪行出错,报什么错也没说,谁知道哪里出错。。如果是iis7+需要配置过iis才能显示具体错误
抱歉疏忽了没把问题写清楚
IIS没有提示哪行出错,打开页面浏览器显示错误为:
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.