Volks AutosChris Nott
Results 1 to 7 of 7
  1. #1
    4th Gear

    Status
    Offline
    Join Date
    Feb 2004
    Location
    Clearfield, PA
    Posts
    892

    HELP ALL ASP PROGRAMMERS!!!

    if your spot on with ASP please PM me.. having major problems with database paging.... [img]/ubbthreads/images/graemlins/frown.gif[/img]



  2. # ADS
    ADS
    Join Date
    Always
    Location
    Global
    Posts
    Many
     
  3. #2
    Grant's Avatar
    5th Gear

    Status
    Offline
    Join Date
    Dec 2003
    Location
    Aberdeen
    Posts
    1,045

    Re: HELP ALL ASP PROGRAMMERS!!!

    ASP sucks! PHP is rocks!

    PM me is you need help though... I know a few decent ASP programmers.

  4. #3
    4th Gear

    Status
    Offline
    Join Date
    Feb 2004
    Location
    Clearfield, PA
    Posts
    892

    Re: HELP ALL ASP PROGRAMMERS!!!

    asp is alot better for what i need it for..

    need a database paging script that actually works instead of the carp examples you get on websites..that dont work.. lol


  5. #4
    Grant's Avatar
    5th Gear

    Status
    Offline
    Join Date
    Dec 2003
    Location
    Aberdeen
    Posts
    1,045

    Re: HELP ALL ASP PROGRAMMERS!!!

    Can you give a better description of what you are wanting?

  6. #5
    4th Gear

    Status
    Offline
    Join Date
    Feb 2004
    Location
    Clearfield, PA
    Posts
    892

    Re: HELP ALL ASP PROGRAMMERS!!!

    ok heres what i have at the moment.

    this script shows alllll the data in the table.

    the fields are as follows

    SubTitle= Request.Form("SubTitle")
    Topic = Request.Form("Topic")
    SubPicThumb = Request.Form("SubPicThumb")
    SubIntro = Request.Form("SubIntro")
    SubDate = Request.Form("SubDate")
    SubSplash = Request.Form("SubSplash")
    SubMain = Request.Form("SubMain")
    SubKeyword = Request.Form("SubKeyword")

    the script to show all is

    ###########################

    <%
    'declare your variables




    'create an ADO connection and recordset object
    Set Conn = Server.CreateObject("ADODB.Connection")
    Set Recordset = Server.CreateObject("ADODB.Recordset")





    'declare your SQL statement that will query the database
    sSQL = "SELECT * FROM articles"

    'define the connection string, specify database driver and the location of the database
    sConnString = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
    "DBQ=" & Server.MapPath("/db/vagdb.mdb") & ";"




    'Open the recordset object executing the SQL statement and return records

    conn.Open sConnString

    recordset.Open sSQL,conn


    'first of all determine whether there are any records
    If Recordset.EOF Then
    Response.Write("No records returned.")
    Else
    'if there are records then loop through the fields
    Do While Not recordset.EOF


    Response.Write("<p><table width=537 cellpadding=0 cellspacing=0 border=0 align=center><tr><td width=3 rowspan=5></td><td width=100 align=center rowspan=5><img src=" & recordset("SubPicThumb") & " border=1 bordercolor=#000000></td><td width=3 align=center rowspan=2></td><td width=294 valign=top><font face=verdana size=1 color=#999999> <b><font face=verdana size=1 color=#999999>[</font></b><a href=" & recordset("Topic") & "/><b><font face=verdana size=1 color=#999999>" & recordset("Topic") & "</font></b></a><b><font face=verdana size=1 color=#999999>]</font></b> <a href=article.asp?keyword=" & recordset("SubKeyword") & "><b><font face=verdana size=1 color=#999999>" & recordset("SubTitle") & "</b></font></a></td></tr><tr><td><font face=verdana size=1 color=#999999>" & recordset("SubIntro") & "</font></td></tr><tr><td height=2></td></tr><tr><td align=right colspan=2><font face=verdana size=1 color=#999999>" & recordset("SubDate") & " </font></td></tr><tr><td height=2></td></tr></table></p>")



    'move on to the next record
    Recordset.MoveNext

    loop

    end if


    'close the connection and recordset objects and free up resources
    Recordset.Close
    Set Recordset = Nothing
    Conn.Close
    Set Conn = Nothing
    %>


    ######################

    now i want it to show 5 records and then at the bottom of the 5 records show pages 1,2,3,4 obviously depending on how many records there are. its something they use on all the search engine when over there are loads of results.. also i want only the 5 to be collected and then when u click 'page 2' is then collects them.. i dont want the script to collect all the data from the table as i want it as quick as possible.


    hope this explains what im after.. :P

  7. #6
    Grant's Avatar
    5th Gear

    Status
    Offline
    Join Date
    Dec 2003
    Location
    Aberdeen
    Posts
    1,045

    Re: HELP ALL ASP PROGRAMMERS!!!

    If you only want to collect the first 5 records, then use the MySQL statement:

    SELECT * FROM articles LIMIT 5

    You'll also need to find out how many records you have and do a calculation of total records divided by 5 and round it up - that how many pages you'll have.

    SELECT COUNT(*) FROM articles

    or

    SELECT COUNT(*) AS totalrecords FROM articles

  8. #7
    4th Gear

    Status
    Offline
    Join Date
    Feb 2004
    Location
    Clearfield, PA
    Posts
    892

    Re: HELP ALL ASP PROGRAMMERS!!!

    humm... will have a blast tonight....

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO

Garage Plus, Vendor Tools vBulletin Plugins by Drive Thru Online, Inc.

Content Relevant URLs by vBSEO