Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: The Most Simple Database Paging - Help

Results 1 to 3 of 3
Share This Thread →
  1. #1
    mrcshbs is offline Registered User
    Join Date
    Oct 2012
    Location
    Saint Louis
    Posts
    9
    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
    gk53's Avatar
    gk53 is offline Contributing User
    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,538
    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

  3. #3
    annaharris is offline Registered User
    Join Date
    Mar 2012
    Location
    USA
    Posts
    76
    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.

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

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

ASP Free Advertisers and Affiliates