| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 851 人关注过本帖
标题:asp 500错误
只看楼主 加入收藏
snddzxb
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-9-13
结帖率:0
收藏
 问题点数:0 回复次数:2 
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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

  </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>
搜索更多相关主题的帖子: 数据库 Server false 老师 
2011-03-05 09:54
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
报错页面写的是什么内容
2011-03-06 13:30
chituma
Rank: 1
等 级:新手上路
帖 子:2
专家分:2
注 册:2010-12-29
收藏
得分:0 
这么复杂啊,看起来都有点晕啊
2011-03-06 13:32
快速回复:asp 500错误
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013411 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved