BenthamLtd
asked on
Recordset paging in VB ASP with mySQL Database
Hi,
I'm building a website that needs to connect to a mySQL database.
Using the code below, I can connect to the database and display x amount of records using the LIMIT function of mySQL.
I now want to be able to page through all the records in blocks of x with the pages listed at the bottom and a total count of records.
How can I do this?
I'm building a website that needs to connect to a mySQL database.
Using the code below, I can connect to the database and display x amount of records using the LIMIT function of mySQL.
I now want to be able to page through all the records in blocks of x with the pages listed at the bottom and a total count of records.
How can I do this?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Set OBJdbConn = Server.CreateObject("ADODB.Connection")
OBJdbConn.Open = "Driver={MySQL ODBC 3.51 Driver};Server=admin-sw;Database=ijtd_export; User=root;Password=cre2unat;Option=3;"
%>
<%
Dim rsCallBackStatus
Dim rsCallBackStatus_numRows
SQLQuery = "SELECT * FROM vallinone LIMIT 0, 20"
Set rsCallBackStatus = OBJdbConn.Execute(SQLQuery)
rsCallBackStatus_numRows = 0
%>
<%do until rsCallBackStatus.eof%>
<%=rsCallBackStatus("Customer_URN")%><br>
<%rsCallBackStatus.movenext
loop%>
<%
rsCallBackStatus.Close()
Set rsCallBackStatus = Nothing
OBJdbConn.Close
Set OBJdbConn = Nothing
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
SQLQuery = "SELECT * FROM vallinone LIMIT " & (currentpage * noofrows)-20 & " , " & noofrows
and then keep a hyperlink below the page with currentpage + 1 in ">" sign and move on.
You will have to put some if else logics for "<" or "<<" and ">" or ">>" and that should be good.