asp 500错误
各位老师,我用的是SQL数据库在保存页面出现500错误,我把代码贴出来,请帮我指正一下,谢谢!conn连接:
<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_conn_STRING
MM_conn_STRING = "Driver={SQL Server};server=192.168.1.9;uid=jwgl;pwd=jwgl;database=jwgl;"
%>
保存页面代码:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/conn.asp" -->
<%
'---------------读取数据----------------
xxid=trim(request.form("xxid"))
njid=trim(request.form("njid"))
ccid=trim(request.form("ccid"))
zyid=trim(request.form("zyid"))
xm=trim(request.form("xm"))
xb=trim(request.form("xb"))
sfzh=trim(request.form("sfzh"))
sj=trim(request.form("sj"))
gzdw=trim(request.form("gzdw"))
dzyx=trim(request.form("dzyx"))
dz=trim(request.form("dz"))
'------------------写入数据-----------
'set rs=server.createobject("adodb.recordset") '建立recordset的对象,初始化rs
'sql="select * from tblxsbm_www"
'rs.open sql,conn,3,2
Dim rs
Dim rs_numRows
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_conn_STRING
rs.Source = "SELECT * FROM dbo.tblxsbm_www"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open()
rs_numRows = 0
rs.addnew
rs("xxid")=xxid
rs("ccid")=ccid
rs("zyid")=zyid
rs("njid")=njid
rs("xm")=xm
rs("xb")=xb
rs("sfzh")=sfzh
rs("sj")=sj
rs("gzdw")=gzdw
rs("dz")=dz
rs("dzyx")=dzyx
rs("czsj") = now()
rs.update
rs.close
response.write("<center><a href='index.asp'>祝贺您报名成功!我们将会有老师与您联系,请保持联系方式畅通!咨询电话:冯老师:13088166018张老师:13982568766</a></center>")
'response.write"<SCRIPT language=JavaScript>alert('祝贺您报名成功!\r\r我们将会有老师与您联系,请保持联系方式畅通!\r\r咨询电话:\r\r冯老师:13088166018\r\r张老师:13982568766');"
'response.write"javascript:history.go(-2)</SCRIPT>"
%>
<%
rs.Close()
Set rs = Nothing
%>
保存页面上一层浏览页面:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/conn.asp" -->
<%
set conn=Server.CreateObject("ADODB.connection")
conn.open MM_conn_STRING
%>
<% xxmc=conn.execute("select xxmc xxid from tblhzxx where xxid='"& request("xxid") &"'")(0) '读取学校名称
%>
<% njmc=conn.execute("select njmc njid from tblnj where njid='"& request("njid") &"'")(0)
%>
<% ccmc=conn.execute("select ccmc ccid from tblcc where ccid='"& request("ccid") &"'")(0)
%>
<% zymc=conn.execute("select zymc zyid from tblzy where zyid='"& request("zyid") &"'")(0)
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/css.css">
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<style type="text/css">
<!--
.style1 { font-size: 24px;
font-weight: bold;
}
-->
</style>
</head>
<p align="center">
<form action="save.asp" method="POST" name="form1" id="form1">
<table width="737" border="1" bordercolor="#FF9933">
<tr>
<td height="40" colspan="2"><div align="center"><span class="style1">遂宁广播电视大学预报名系统</span></div></td>
</tr>
<tr>
<td width="188" height="30" bordercolor="#FFCC33"><div align="right">学校</div></td>
<td width="533"><span></span> </span>
<%response.write xxmc%></td>
</tr>
<tr>
<td height="30" bordercolor="#FFCC33"><div align="right">年级</div></td>
<td>
<%response.write njmc%></td>
</tr>
<tr>
<td height="30" bordercolor="#FFCC33"><div align="right">层次</div></td>
<td>
<%response.write ccmc%></td>
</tr>
<tr>
<td height="30" bordercolor="#FFCC33"><div align="right">专业</div></td>
<td>
<%response.write zymc%></td>
</tr>
<tr>
<td height="30" bordercolor="#FFCC33"><div align="right">姓名</div></td>
<td><%=request("xm")%></td>
</tr>
<tr>
<td height="30" bordercolor="#FFCC33"><div align="right">性别</div></td>
<td><%=request("xb")%></td>
</tr>
<tr>
<td height="30" bordercolor="#FFCC33"><div align="right">
<p>身份证号(士兵;军官证号)</p>
</div></td>
<td><%=request("sfzh")%></td>
</tr>
<tr>
<td height="30" bordercolor="#FFCC33"><div align="right">联系电话</div></td>
<td><%=request("sj")%></td>
</tr>
<tr>
<td height="30" bordercolor="#FFCC33"><div align="right">工作单位</div></td>
<td><%=request("gzdw")%></td>
</tr>
<tr>
<td height="30" bordercolor="#FFCC33"><div align="right">邮箱</div></td>
<td><%=request("dzyx")%></td>
</tr>
<tr>
<td height="30" bordercolor="#FFCC33"><div align="right">地址</div></td>
<td><%=request("dz")%></td>
</tr>
<tr>
<td height="30" colspan="2">报名咨询电话冯老师:13088166018;张老师:13982568766</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input name="button" type="button" onClick="history.back()" value="返回修改">
<input type="submit" value="确定保存" name="B1">
</div></td>
</tr>
</table>
<p align="center">
</p>
<div style="display:none;"><INPUT type=hidden VALUE="<%=request("xxid")%>" name="xxid">
<INPUT type=hidden VALUE="<%=Server.HTMLEncode(request("njid"))%>" name=njid>
<INPUT type=hidden VALUE="<%=request("zyid")%>" name="zyid">
<INPUT type=hidden VALUE="<%=request("ccid")%>" name="ccid">
<INPUT type=hidden VALUE="<%=request("xm")%>" name="xm">
<INPUT type=hidden VALUE="<%=request("xb")%>" name="xb">
<INPUT type=hidden VALUE="<%=request("sfzh")%>" name="sfzh">
<INPUT type=hidden VALUE="<%=request("sj")%>" name="sj">
<INPUT type=hidden VALUE="<%=request("gzdw")%>" name="gzdw">
<INPUT type=hidden VALUE="<%=request("dz")%>" name="dz">
<INPUT type=hidden VALUE="<%=request("dzyx")%>" name="dzyx">
</div>
</form>
</body>
</html>