怎样解决错误对象,急!!

来源:百度知道 编辑:UC知道 时间:2024/07/04 11:31:37
帮忙看下啊!提示:
行:13
字符:1
错误:缺少对象
代码:0
以下是ASP的部分源文件,帮忙看下啊.

<!--#include file="Inc/syscode_article.asp"-->
<!--#include file="Connections/conn.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT * FROM baoban"
Recordset1.CursorType = 1
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0 ==这就是13行的部分.
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 6
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>

Recordset1_numRows = 0
前边加一个set或者在定义时,把类型定义出来,也可以先定义出一个值。我就想不明白了,为什么到13行才出现对值的定义呢?dim的定义在VB中是只定义了一个就是名,并没有定义其类型,而VB又是一种强定义型的语言。所以要么你在定义变量时指定类型,要么用set来定义值!

试试看吧!

在第一个<%%>里你定义的dim recordset1_numrows,而且值为Recordset1_numRows = 0

在第二个<%%>中你又定义同样的dim recordset1_numrows,而且值为Recordset1_numRows = 6

你让程序使用哪个?所以出错了!