标题:[求助]请问一下这个代码应该怎么写?
只看楼主
lihaoru
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2004-11-11
 问题点数:0 回复次数:8 
[求助]请问一下这个代码应该怎么写?
m_CallerID 取到值以后跳出页面: http://localhost/wwww/ddd.asp?m_CallerID=2102 页面上显示 第 1 页,共 2页 但当我做了一个下一个的按钮以后就出现

Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

ADODB.Recordset 错误 '800a0bcd'

BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。

/wwww/ddd.asp,行66 URL是:http://localhost/wwww/ddd.asp?m_CallerID=2102curpage=2 我想问一下我的写法是不是有问题 Response.Write("<INPUT TYPE=BUTTON VALUE=NEXT ONCLICK=""document.location.href='ddd.asp?m_CallerID=" & CallerID & "curpage=" & curpage + 1 & "';"">") 请帮忙,谢谢

[此贴子已经被作者于2005-10-20 13:09:16编辑过]

搜索更多相关主题的帖子: 代码 
2005-10-20 13:00
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5807
专家分:108
注 册:2005-4-7
得分:0 
把代码帖出来

这种错误一般是你
RS的真值的错误
比如你写IF NOT RS.EOF AND RS.BOF  THEN
其实应该写成IF NOT (RS.EOF AND RS.BOF) THEN
这样是逻辑错误

2005-10-20 13:11
lihaoru
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2004-11-11
得分:0 

<!--#include file="config.asp"--> <!--#include file="conn.asp"--> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> <script language="vbscript" runat="server"> '''电话号码转换 function change(callid) if mid(callid,1,2) = "13" then change = callid elseif mid(callid,1,3) = "013" then change = callid elseif len(callid) >= 11 then change = mid(callid,len(callid)-6,7) else change = callid end if end function '''''''''''''''''''''''''''''''''''''''''''''''' Function DataToRsStatic(Conn,strSql) Dim RsStatic On Error Resume NexT Set DataToRsStatic = Nothing If Conn Is Nothing Then Exit Function End If Set RsStatic = CreateObject("ADODB.RecordSet") RsStatic.CursorLocation = 3 RsStatic.Open strSql,Conn,3,3 If Err.Number <> 0 Then Exit Function End If set DataToRsStatic = RsStatic End Function

</script> </head>

<body> <% '''''''''''''''''''''''''''''''''''''''''''' Const NumPerPage = 1 ''''''''''''''''''''''''''''''''''''''''''''' Dim CurPage If Request.QueryString("CurPage") = "" then CurPage = 1 'We're on the first page Else CurPage = Request.QueryString("CurPage") End If ''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''

dim CallerID CallerID = request.QueryString("m_CallerID") CallerID = change(CallerID) Dim conn Set Conn = CreateObject("ADODB.Connection") conn.open "DRIVER={SQL Server};SERVER=192.168.0.100;DATABASE=Zsa;UID=sa;PWD=dss" strSql = "SELECT * FROM T_Customerinfo where Chandset1 = '" & CallerID & "' or Chandset2 = '" & CallerID & "' or Ctel like '" & CallerID & "'" set rstData = DataToRsStatic(conn, strSql)

'rstData.CacheSize = NumPerPage

rstData.MoveFirst rstData.PageSize = NumPerPage

Dim TotalPages TotalPages = rstData.PageCount rstData.AbsolutePage = CurPage

Dim count Count = 0 Do While Not rstData.EOF And Count < rstData.PageSize response.write("注册帐号:"& rstData("Cnickname")) response.write("<br>会员姓名:"& rstData("Cname")) response.write("<br>性别:"& rstData("Csex")) response.write("<br>家庭住址:"& rstData("Caddress")) response.Write("<br>手机1:"& rstData("Chandset1")) response.Write("<br>手机2:"& rstData("Chandset2")) response.Write("<br>固定电话区号:"& rstData("Ctelfirst")) response.Write("<br>固定电话号码:"& rstData("Ctel")) response.Write("<br>是否黑名:"& rstData("Cblack")) response.Write("<br>会员状态:"& rstData("Cstatus")) response.Write("<br>消费积分:"& rstData("Cconsumescore")) response.Write("<br>会员积分:"& rstData("Cscore")) response.Write("<br>会员级别"& rstData("Clevel")) Count = Count + 1 rstData.MoveNext Loop Response.Write("<br>第 " & CurPage & " 页,共 " & TotalPages & "页<P>") rstData.Close Set rstData = nothing conn.close Set conn=Nothing '显示 Next / Prev 按钮 if CurPage > 1 then Response.Write("<INPUT TYPE=BUTTON VALUE=PREV ONCLICK=""document.location.href='ddd.asp?m_CallerID=" & CallerID & "curpage=" & curpage - 1 & "';"">") End If

if CInt(CurPage) <> CInt(TotalPages) then Response.Write("<INPUT TYPE=BUTTON VALUE=NEXT ONCLICK=""document.location.href='ddd.asp?m_CallerID=" & CallerID & "curpage=" & curpage + 1 & "';"">") End If

%> </body> </html>

[此贴子已经被作者于2005-10-20 13:18:40编辑过]

2005-10-20 13:16
lihaoru
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2004-11-11
得分:0 
请大家帮帮忙,谢谢了
2005-10-20 13:43
lihaoru
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2004-11-11
得分:0 
请大家帮帮忙
2005-10-20 14:48
盖茨他爹
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:5255
专家分:0
注 册:2005-5-3
得分:0 
66行代码
2005-10-20 16:54
syh878
Rank: 1
等 级:新手上路
威 望:2
帖 子:461
专家分:0
注 册:2005-9-2
得分:0 
数据库里有你要找的东西吗??

2005-10-20 17:47
lihaoru
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2004-11-11
得分:0 
数据库里有东西的,会显示有2页的
2005-10-21 09:33
jnzsk
Rank: 1
等 级:新手上路
威 望:1
帖 子:403
专家分:0
注 册:2004-11-13
得分:0 
你一定有一个数据表为空了!你得加一个判断语句!

2005-10-21 16:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-30727-1-1.html




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

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