主题:  为什么正常查询能找到?

wxq_5d

职务:普通成员
等级:1
金币:0.0
发贴:23
注册:2002/7/24 17:11:22
#12002/8/21 9:04:22
为什么正常查询能找到?
查询没有的记录就显示这个问题!
但为什么我也加了 什么第几条到第几条找到多少条?
如果没找到就显示 0条到第0条找到0条,为什么这个信息也不显示!而显示出错呢?

(1)页面出现这个效果
ADODB.Recordset 错误 '800a0bcd'

BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,但应用程序要求操作的是当前的记录。

56

原文件

<%
Dim twe__MMColParam
twe__MMColParam = "1"
if (Request.QueryString("bt") <> "") then twe__MMColParam = Request.QueryString("bt")
%>
<%
set twe = Server.CreateObject("ADODB.Recordset")
twe.ActiveConnection = MM_nmkj_STRING
twe.Source = "SELECT * FROM new WHERE bt LIKE '%" + Replace(twe__MMColParam, "'", "''") + "%'"
twe.CursorType = 0
twe.CursorLocation = 2
twe.LockType = 3
twe.Open()
twe_numRows = 0
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' set the record count
twe_total = twe.RecordCount

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

' set the first and last displayed record
twe_first = 1
twe_last = twe_first + twe_numRows - 1

' if we have the correct record count, check the other stats
If (twe_total <> -1) Then
If (twe_first > twe_total) Then twe_first = twe_total
If (twe_last > twe_total) Then twe_last = twe_total
If (twe_numRows > twe_total) Then twe_numRows = twe_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (twe_total = -1) Then

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

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

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

' set the first and last displayed record
twe_first = 1
twe_last = twe_first + twe_numRows - 1
If (twe_first > twe_total) Then twe_first = twe_total
If (twe_last > twe_total) Then twe_last = twe_total

End If
%>


Untitled Document





<%=(twe.Fields.Item("bt").value)%>


Records <%=(twe_first)%> to <%=(twe_last)%> of <%=(twe_total)%>





<%
twe.Close()
%>


/TMP5db9kdg2fz.asp, 行56






奔腾的心

职务:普通成员
等级:7
金币:10.0
发贴:6114
注册:2001/11/4 15:11:47
#22002/8/21 9:06:06
你没有设置当查找为空时应显示的效果

所以它也不知道怎么办好了,就给你个错误提示了



wxq_5d

职务:普通成员
等级:1
金币:0.0
发贴:23
注册:2002/7/24 17:11:22
#32002/8/21 9:12:45
xiaoning 哥们


能不能说详细一些我很菜的?



wxq_5d

职务:普通成员
等级:1
金币:0.0
发贴:23
注册:2002/7/24 17:11:22
#42002/8/21 9:13:32
xiaoning 哥们


能不能说详细一些我很菜的?
我用Ultradev 编程的?



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
#52002/8/21 10:18:25
增加一个Show Region if Recordset is not empty