| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 447 人关注过本帖
标题:求教: HTTP 错误 500.100 消失后,在搜索栏只能搜索第1条记录
只看楼主 加入收藏
sdfox
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2012-3-13
结帖率:83.33%
收藏
已结贴  问题点数:20 回复次数:3 
求教: HTTP 错误 500.100 消失后,在搜索栏只能搜索第1条记录
我因以姓名做搜索栏之前做了一个静态网页,出现 HTTP 错误 500.100 - 内部服务器错误 - ASP 错误,不能显示内容,应怎样改正?请求热心者教一下!
1.表样
序号    {Recordset1.序号}

姓名    {Recordset1.姓名}

部门    {Recordset1.部门}

编号    {Recordset1.编号}


2.无法显示网页
试图访问的网页出现问题,无法显示。
请尝试执行下列操作:
    单击刷新按钮,或稍后重试。
    打开 localhost 主页,然后查找与所需信息相关的链接。
HTTP 错误 500.100 - 内部服务器错误 - ASP 错误
Internet 信息服务
技术信息(用于支持人员)
    错误类型:
ADODB.Field (0x800A0BCD)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/SS.asp, 第 108 行
    浏览器类型:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
    网页:
GET /SS.asp
    时间:
2012年12月22日, 下午 01:48:56
详细信息:
Microsoft 支持

3.代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/huyb.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.Form("姓名") <> "") Then
  Recordset1__MMColParam = Request.Form("姓名")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_huyb_STRING
Recordset1.Source = "SELECT * FROM 表1 WHERE 姓名 = '" + Replace(Recordset1__MMColParam, "'", "''") + "' ORDER BY 姓名 ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim Recordset1_total
Dim Recordset1_first
Dim Recordset1_last

' set the record count
Recordset1_total = Recordset1.RecordCount

' set the number of rows displayed on this page
If (Recordset1_numRows < 0) Then
  Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
  Recordset1_numRows = 1
End If

' set the first and last displayed record
Recordset1_first = 1
Recordset1_last  = Recordset1_first + Recordset1_numRows - 1

' if we have the correct record count, check the other stats
If (Recordset1_total <> -1) Then
  If (Recordset1_first > Recordset1_total) Then
    Recordset1_first = Recordset1_total
  End If
  If (Recordset1_last > Recordset1_total) Then
    Recordset1_last = Recordset1_total
  End If
  If (Recordset1_numRows > Recordset1_total) Then
    Recordset1_numRows = Recordset1_total
  End If
End If
%>

<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (Recordset1_total = -1) Then

  ' count the total records by iterating through the recordset
  Recordset1_total=0
  While (Not Recordset1.EOF)
    Recordset1_total = Recordset1_total + 1
    Recordset1.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (Recordset1.CursorType > 0) Then
    Recordset1.MoveFirst
  Else
    Recordset1.Requery
  End If

  ' set the number of rows displayed on this page
  If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then
    Recordset1_numRows = Recordset1_total
  End If

  ' set the first and last displayed record
  Recordset1_first = 1
  Recordset1_last = Recordset1_first + Recordset1_numRows - 1
  
  If (Recordset1_first > Recordset1_total) Then
    Recordset1_first = Recordset1_total
  End If
  If (Recordset1_last > Recordset1_total) Then
    Recordset1_last = Recordset1_total
  End If

End If
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<table width="542" border="1">
  <tr>
    <td width="90" height="46">序号</td>
    <td width="436"><%=(Recordset1.Fields.Item("序号").Value)%></td>
  </tr>
  <tr>
    <td height="40">姓名</td>
    <td><%=(Recordset1.Fields.Item("姓名").Value)%></td>
  </tr>
  <tr>
    <td height="41">部门</td>
    <td><%=(Recordset1.Fields.Item("部门").Value)%></td>
  </tr>
  <tr>
    <td height="49">编号</td>
    <td><%=(Recordset1.Fields.Item("编号").Value)%></td>
  </tr>
</table>
<%=(Recordset1_first)%>
<%=(Recordset1_last)%>
<%=(Recordset1_total)%>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>


[ 本帖最后由 sdfox 于 2012-12-24 19:01 编辑 ]
搜索更多相关主题的帖子: localhost Internet 信息服务 服务器 记录 
2012-12-22 14:28
sdfox
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2012-3-13
收藏
得分:0 
internet 选项中的显示友好 HTTP 错误信息,我已删除!还是不行呀!我用的XP是V32.5
2012-12-22 19:32
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:20 
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
这句话的意思很明确了,你sql查询没有记录,返回的记录集是空的

----我怎能在别人的苦难面前转过脸去----
2012-12-23 21:40
sdfox
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2012-3-13
收藏
得分:0 
回复 3楼 dzt0001
能从搜索栏搜索第一条,但无论输入什么都只能搜出第一条!
以姓名为搜索关键词,代码如下:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/huyb.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.Form("编号") <> "") Then
  Recordset1__MMColParam = Request.Form("编号")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_huyb_STRING
Recordset1.Source = "SELECT * FROM 表1 WHERE 编号 = " + Replace(Recordset1__MMColParam, "'", "''") + ""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<table width="417" border="1">
  <tr>
    <td width="90" height="42"><div align="center">序号</div></td>
    <td width="311"><%=(Recordset1.Fields.Item("序号").Value)%></td>
  </tr>
  <tr>
    <td height="35"><div align="center">姓名</div></td>
    <td><%=(Recordset1.Fields.Item("姓名").Value)%></td>
  </tr>
  <tr>
    <td height="37"><div align="center">部门</div></td>
    <td><%=(Recordset1.Fields.Item("部门").Value)%></td>
  </tr>
  <tr>
    <td height="36"><div align="center">编号</div></td>
    <td><%=(Recordset1.Fields.Item("编号").Value)%></td>
  </tr>
</table>

<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<a href="ZY1.asp">返回</a>
2012-12-24 18:50
快速回复:求教: HTTP 错误 500.100 消失后,在搜索栏只能搜索第1条记录
数据加载中...
 
   



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

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