%@LANGUAGE="JAVASCRIPT"%>
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_conncount_STRING;
Recordset1.Source = "SELECT * FROM webcount";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%>
<%
// *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
// set the record count
var Recordset1_total = Recordset1.RecordCount;
// set the number of rows displayed on this page
if (Recordset1_numRows < 0) { // if repeat region set to all records
Recordset1_numRows = Recordset1_total;
} else if (Recordset1_numRows == 0) { // if no repeat regions
Recordset1_numRows = 1;
}
// set the first and last displayed record
var Recordset1_first = 1;
var Recordset1_last = Recordset1_first + Recordset1_numRows - 1;
// if we have the correct record count, check the other stats
if (Recordset1_total != -1) {
Recordset1_numRows = Math.min(Recordset1_numRows, Recordset1_total);
Recordset1_first = Math.min(Recordset1_first, Recordset1_total);
Recordset1_last = Math.min(Recordset1_last, Recordset1_total);
}
%>
<%
// *** Recordset Stats: if we don't know the record count, manually count them
if (Recordset1_total == -1) {
// count the total records by iterating through the recordset
for (Recordset1_total=0; !Recordset1.EOF; Recordset1.MoveNext()) {
Recordset1_total++;
}
// reset the cursor to the beginning
if (Recordset1.CursorType > 0) {
if (!Recordset1.BOF) Recordset1.MoveFirst();
} else {
Recordset1.Requery();
}
// set the number of rows displayed on this page
if (Recordset1_numRows < 0 || Recordset1_numRows > Recordset1_total) {
Recordset1_numRows = Recordset1_total;
}
// set the first and last displayed record
Recordset1_last = Math.min(Recordset1_first + Recordset1_numRows - 1, Recordset1_total);
Recordset1_first = Math.min(Recordset1_first, Recordset1_total);
}
%>