Hi:
I'm developing a web-based application using Dreamweaver MX with ASP on the front-end and MS SQL Server 2000 on the back-end.
I have the following code that creates a record set within Dreamweaver MX and I'm trying to use the RecordCount property of the record set to get a count of the number of records generated during runtime for the records listed on
the web page:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Option Explicit
Dim strPreStatus %>
<!--#include file="../../Connections/sar.asp" -->
<%
Dim rsSuspenseLog
Dim rsSuspenseLog_numRows
Set rsSuspenseLog = Server.CreateObject("ADODB.Recordset")
rsSuspenseLog.ActiveConnection = MM_sar_STRING
rsSuspenseLog.Source = "SELECT * FROM dbo.QryUnionBase_ViewRpt"
rsSuspenseLog.CursorType = 0
rsSuspenseLog.CursorLocation = 2
rsSuspenseLog.LockType = 1
rsSuspenseLog.Open()
rsSuspenseLog_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsSuspenseLog_numRows = rsSuspenseLog_numRows + Repeat1__numRows
%>
<% Function CountRecords
'returns the total records for the report.
CountRecords = rsSuspenseLog.RecordCount
End Function
%>
<html>
<head>
<title>Suspense Log Report</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="100%" height="30" border="0" cellpadding="0">
<tr bordercolor="#000000" height="30">
....
<td width="25%"> <div align="right"><font size="3">Count: <%=CountRecords%></font></div></td>
</tr>
</table>
The problem is that when I run the report, I receive an error because the Count equals -1.
e.g. Count: -1
Can anyone advise on what the problem could be? Is this a SQL Server 2000 issue?
Any help on this matter would be greatly appreciated.
Thanks,
Cheryl
I'm developing a web-based application using Dreamweaver MX with ASP on the front-end and MS SQL Server 2000 on the back-end.
I have the following code that creates a record set within Dreamweaver MX and I'm trying to use the RecordCount property of the record set to get a count of the number of records generated during runtime for the records listed on
the web page:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Option Explicit
Dim strPreStatus %>
<!--#include file="../../Connections/sar.asp" -->
<%
Dim rsSuspenseLog
Dim rsSuspenseLog_numRows
Set rsSuspenseLog = Server.CreateObject("ADODB.Recordset")
rsSuspenseLog.ActiveConnection = MM_sar_STRING
rsSuspenseLog.Source = "SELECT * FROM dbo.QryUnionBase_ViewRpt"
rsSuspenseLog.CursorType = 0
rsSuspenseLog.CursorLocation = 2
rsSuspenseLog.LockType = 1
rsSuspenseLog.Open()
rsSuspenseLog_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsSuspenseLog_numRows = rsSuspenseLog_numRows + Repeat1__numRows
%>
<% Function CountRecords
'returns the total records for the report.
CountRecords = rsSuspenseLog.RecordCount
End Function
%>
<html>
<head>
<title>Suspense Log Report</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="100%" height="30" border="0" cellpadding="0">
<tr bordercolor="#000000" height="30">
....
<td width="25%"> <div align="right"><font size="3">Count: <%=CountRecords%></font></div></td>
</tr>
</table>
The problem is that when I run the report, I receive an error because the Count equals -1.
e.g. Count: -1
Can anyone advise on what the problem could be? Is this a SQL Server 2000 issue?
Any help on this matter would be greatly appreciated.
Thanks,
Cheryl