当前位置:编程学习 > asp >>

帮忙看下这段asp程序错在哪里?

我是用的DW自带的记录集和重复区域来实现留言的功能,运行的时候报如下错误: Microsoft VBScript 运行时错误 '800a01a8' 缺少对象 \massage.asp, line 44,其中massage.asp是下面一段代码保存的文件名 连用DW自带的插入功能居然会报错,真的让人很无语!!代码如下: <%@LANGUAGE="VBSCRIPT"%> <!--#include file="Connections/conn.asp" --> <% Dim liuyan Dim liuyan_numRows Set liuyan = Server.CreateObject("ADODB.Recordset") liuyan.ActiveConnection = MM_conn_STRING liuyan.Source = "SELECT * FROM dbo.评论" liuyan.CursorType = 0 liuyan.CursorLocation = 2 liuyan.LockType = 1 liuyan.Open() liuyan_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = 5 Repeat1__index = 0 liuyan_numRows = liuyan_numRows + Repeat1__numRows %><style type="text/css"> <!-- .STYLE2 {color: #0000FF} .STYLE3 {color: #000000; font-weight: bold; } --> </style> <table width="100%" border="0"> <tr> <td><!--#include file="head.asp"--></td> </tr> </table> <p><% liuyan.Close() Set liuyan = Nothing %> </p> <% While ((Repeat1__numRows <> 0) AND (NOT liuyan.EOF)) %> <div align="center"> <table width="57%" height="67" border="1" bordercolor="#0000FF"> <tr> <td width="26%" height="22"><div align="center" class="STYLE3">留言主题</div></td> <td width="37%"><div align="center" class="STYLE3">主要内容</div></td> <td width="17%"><div align="center" class="STYLE3">留言者</div></td> <td width="20%"><div align="center" class="STYLE3">留言时间</div></td> </tr> <tr> <td><span class="STYLE2"><%=(liuyan.Fields.Item("标题").Value)%></span></td> <td><span class="STYLE2"><%=(liuyan.Fields.Item("评论内容").Value)%></span></td> <td><span class="STYLE2"><%=(liuyan.Fields.Item("姓名").Value)%></span></td> <td><span class="STYLE2"><%=(liuyan.Fields.Item("评论时间").Value)%></span></td> </tr> </table> </div> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 liuyan.MoveNext() Wend %>
追问:
        	
				
应该怎么改呢,留言是记录集的名称
答案:……
<p><%
liuyan.Close()   ‘关闭数据库记录集
Set liuyan = Nothing   '清除自定义变量
%>
</p>


<% 
While ((Repeat1__numRows <> 0) AND (NOT liuyan.EOF))  '当……并且 liuyan记录集结尾
……


这里,先关闭记录集并清空内存之后,再调用liuyan.eof,指定出错。liuyan没有被定义或者不是对象……,不应该有.eof属性……
其他:请删除37行和38行后测试
37行:liuyan.Close()
38行:Set liuyan = Nothing 

上一个:你好 可不可以帮我调试下程序啊 是用C#和asp.net的 我的qq是957261564
下一个:求高人帮忙:asp程序上传至服务器, 后台添加图片提示成功,前台图片不显示,显示“X”。

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,