View Single Post
  #2 (permalink)  
Old Feb 12th, 2008, 02:37
Monie Monie is offline
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Re: AbsolutePage in MySQL

Yes, I am happily solving this thread
It all about the cursor type that causes all that error! What I do is to force ADO to construct a static cursor by specifying a client-side cursor!!!

My previous Database Connection (updated with the static cursor):
Code: Select all
Dim connString, rs, conn
connString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER="& DB_SERVER &"; DATABASE="& DB_NAME &"; OPTION=4; UID="& DB_USER &"; PASSWORD="& DB_PASS &";"
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.cursorlocation = 3
conn.Open(connString)
And the If statement just works FINE

Code: Select all
If Not rs.EOF Then
    rs.MoveFirst
    rs.PageSize = NumPerPage
    TotalPages = rs.PageCount

    rs.AbsolutePage = CurrentPage
End If

Last edited by Monie; Feb 12th, 2008 at 02:40.
Reply With Quote