D
Dave Lagergren
I am using the following code to find the largest record number in a
database. I have an include file that handles getting the database open.
The "ordernumber" column of the database is sorted in ascending order. This
only gets to 1.
<%
DIM mySQL, iRecordCount, iRC
iRC = 1
mySQL = "SELECT * FROM Results"
objRS.Open mySQL, objConn
DO WHILE NOT objRS.EOF
if cStr(iRC) = objRS("OrderNumber") then
iRC = iRC + 1
Response.Write ">> IRC= " & iRC & "<<"
objRS.MoveNext
else
Exit Do
end if
Loop
iRecordCount = cStr(iRC)
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
database. I have an include file that handles getting the database open.
The "ordernumber" column of the database is sorted in ascending order. This
only gets to 1.
<%
DIM mySQL, iRecordCount, iRC
iRC = 1
mySQL = "SELECT * FROM Results"
objRS.Open mySQL, objConn
DO WHILE NOT objRS.EOF
if cStr(iRC) = objRS("OrderNumber") then
iRC = iRC + 1
Response.Write ">> IRC= " & iRC & "<<"
objRS.MoveNext
else
Exit Do
end if
Loop
iRecordCount = cStr(iRC)
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>