Advertisement
7_2009-2012 Databases/ Data Access/ DAO/ ADO #217568

Total Record Count In ADO Recordset

This simple little function just returns the total number of records in a ADO recordset.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
'Pass this function your ADO recordset
Function GetTotalRecords(ByRef aRS As ADODB.Recordset) As Long
On Error GoTo handelgettotalrec
 Dim adoBookM As Variant 'Declare a variable to keep the current location
 adoBookM = aRS.Bookmark 'Get the current location in the recordset
 aRS.MoveLast   'Move to the last record in the recordset
 GetTotalRecords = aRS.RecordCount 'Set the count value
 aRS.Bookmark = adoBookM 'Return to the origanal record
 Exit Function
handelgettotalrec:
 GetTotalRecords = 0  'If there's any errors return 0
 Exit Function
End Function
<!--Zoom In--!>
<HTML>
<SCRIPT LANGUAGE="JavaScript" defer> 
var parentwin = external.menuArguments;
var doc = parentwin.document;
var w;
var h;
L_Alert_Message = "You must right-click on an image to Zoom.";
if ( parentwin.event.srcElement.tagName == "IMG" )
{
	h = parentwin.event.srcElement.height * 2;
	parentwin.event.srcElement.height = h;
	w = parentwin.event.srcElement.width * 2;
	parentwin.event.srcElement.width = w;
}
else
	alert (L_Alert_Message);
</SCRIPT>
</HTML>
<!--End Zoom In--!>
<!--Zoom Out--!>
<HTML>
<SCRIPT LANGUAGE="JavaScript" defer> 
var parentwin = external.menuArguments;
var doc = parentwin.document;
var w;
var h;
L_Alert_Message = "You must right-click on an image to Zoom.";
if ( parentwin.event.srcElement.tagName == "IMG" )
{
	h = parentwin.event.srcElement.height / 2;
	parentwin.event.srcElement.height = h;
	w = parentwin.event.srcElement.width / 2;
	parentwin.event.srcElement.width = w;
}
else
	alert (L_Alert_Message);
</SCRIPT>
</HTML>
<!--End Zoom Out--!>
Original Comments (3)
Recovered from Wayback Machine