#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2012
    Location
    Saint Louis
    Posts
    10
    Rep Power
    0

    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.
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,581
    Rep Power
    278
    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 Give Rep button (bottom side on this reply ) and agree
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2012
    Location
    USA
    Posts
    75
    Rep Power
    0
    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

  1. i hate asp. cant do simple paging
    By drunknbass in forum ASP Development
    Replies: 9
    Last Post: May 1st, 2006, 11:08 AM
  2. Database Paging..........
    By ianwillo in forum ASP Development
    Replies: 2
    Last Post: January 26th, 2006, 10:46 AM
  3. help with database paging
    By cthulu in forum ASP Development
    Replies: 5
    Last Post: July 19th, 2004, 09:52 AM
  4. paging of database!!
    By Steve Schofield in forum ASP Development
    Replies: 1
    Last Post: May 30th, 2001, 06:29 AM
  5. Paging a database recordset
    By Steve Schofield in forum ASP Development
    Replies: 1
    Last Post: May 25th, 2000, 08:22 AM

IMN logo majestic logo threadwatch logo seochat tools logo