- Total Members: 220,002
- Threads: 525,379
- Posts: 976,969
-
November 10th, 2012, 11:04 AM
#1
The Most Simple Database Paging - Help
Hi guys,
I am trying to create the most simple database paging possible… something really simple.
This is what I have:
Connection.asp
<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objconn.Open "DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost;UID=admin;pwd=pass;database=data_ schema;option=16384;"
%>
This is the records.asp
<!-- #include file ="/include/connection.asp" -->
Dim rs,sql
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM users WHERE(USERid='"&request.form("USERid")&"')"
rs.Open sql, objConn
Do While Not rs.EOF
varusrid=""&rs("USERid")&""
varlastname=""&rs("USERlastname")&""
Else
Response.Redirect "error.asp"
End If
Rs.MoveNext
Loop
rs.Close
objConn.Close
response.write varusrid &”<br>”
response.write varlastname &”<br>”
%>
This works, but shows all the records… what I am trying to do is simple with as little lines as possible.
All I would like a database paging like this:
Table (NAMES)
Record1
Record2
Record 3
Record 4
[Next Page] [Previous Page] Page 1 of 200 Select Page [Drop down Pages]
Any help would be appreciate it.
Marcos.
-
November 13th, 2012, 01:21 PM
#2
sql = "SELECT * FROM users WHERE(USERid='"&request.form("USERid")&"')"
should give your one record?
code
Do While Not rs.EOF
varusrid=""&rs("USERid")&""
varlastname=""&rs("USERlastname")&""
Else
Response.Redirect "error.asp"
End If
Rs.MoveNext
Loop
missing if open part....
Code you published does not make sense... If you expect help please publish your code and describe a problem
GK
__________________________________________________ _____
if you found this post is useful click scale

(right side on this reply ) and agree
-
December 27th, 2012, 05:32 AM
#3
Thanks a lot mrcshbs. Really, you shared a thing which is most appropriate with my work. I know about how to do simple database paging, but this is easier method than that.
Similar Threads
-
By drunknbass in forum ASP Development
Replies: 9
Last Post: May 1st, 2006, 11:08 AM
-
By ianwillo in forum ASP Development
Replies: 2
Last Post: January 26th, 2006, 10:46 AM
-
By cthulu in forum ASP Development
Replies: 5
Last Post: July 19th, 2004, 09:52 AM
-
By Steve Schofield in forum ASP Development
Replies: 1
Last Post: May 30th, 2001, 06:29 AM
-
By Steve Schofield in forum ASP Development
Replies: 1
Last Post: May 25th, 2000, 08:22 AM