MM_rsCount) MM_size = MM_rsCount; } // if we walked off the end, set the offset based on page size if (!@@rsName@@_hasData && !MM_paramIsDefined) { if (MM_offset > MM_rsCount - MM_size || MM_offset == -1) { //check if past end or last if (MM_rsCount % MM_size != 0) //last page has less records than MM_size MM_offset = MM_rsCount - MM_rsCount % MM_size; else MM_offset = MM_rsCount - MM_size; } } // reset the cursor to the beginning @@rsName@@.close(); @@resetRecordsetCall@@ @@rsName@@_hasData = @@rsName@@.next(); MM_rs = @@rsName@@; // move the cursor to the selected record for (i=0; @@rsName@@_hasData && i < MM_offset; i++) { @@rsName@@_hasData = MM_rs.next(); } } %> ]]>