![]() |
Admin 7/5/2005 |
Julien, setupRs.Move nPageSize * (mypage-1)
if nPageSize (mypage-1) > 0 then setupRs.Move nPageSize (mypage-1)
|
|
500279 7/5/2005 |
Thanks for your prompt reply. This has fixed the problem of the page not loading, but there are still no page navigation links. The page info at the top of the page says: |
![]() |
Admin 7/6/2005 |
Julien, function setupRs(strConnection,strSQL,nPageSize) Err.Clear Set setupRs = server.CreateObject ("ADODB.Recordset") if GetDatabaseType()=DATABASE_MySQL or GetDatabaseType()=DATABASE_Oracle then setupRs.CursorLocation = 3 set dbConnection = server.CreateObject ("ADODB.Connection") dbConnection.ConnectionString = strConnection On Error Resume Next dbConnection.Open Call ReportError LogInfo(strSQL) setupRs.open strSQL,dbConnection, 1, 2 Call ReportError On Error Goto 0 ' Pagination: if NOT setupRs.EOF then Set rsCount = server.CreateObject ("ADODB.Recordset") n = InStr(lcase(strSQL), " from ") if n>1 then response.write "select count() " & Mid(strSQL, n) rsCount.open "select count() " & Mid(strSQL, n),dbConnection, 1, 2 maxRecords = rsCount(0) rsCount.Close : set rsCount = Nothing end if ' maxRecords = cdbl(setupRs.RecordCount) maxpages = maxRecords \ nPageSize if maxRecords mod nPageSize > 0 then maxpages =maxpages +1 if cdbl(mypage) > cdbl(maxpages) then mypage = maxpages maxrecs=nPageSize setupRs.MoveFirst if nPageSize (mypage-1) > 0 then setupRs.Move nPageSize (mypage-1) End IF end function |
|
500280 7/6/2005 |
Sergey, |
![]() |
Admin 7/12/2005 |
Julien, |