Returning Records from <cfquery>

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Returning Records from <cfquery>

    I would like to return a large list of records 300+ to a web page without using
    frames. The problem occurs when users scroll up or down to view the records.
    The title row moves up and down with the returned records. Is there a way for
    the title row to remain stationary? When the row remains stationary for the
    large set of records, it will need to autosize to the same column width of the
    data being brought back. (hope this makes sense)

    I am using CF5.

    Thanks!

    pnugent Guest

  2. Similar Questions and Discussions

    1. cfquery bug...still?
      Hi, I have ColdFusion MX7,0,0,91690. I am trying to utilize the attached code. I am passing the query (it's easier for my implementation) in a...
    2. cfquery
      I am trying to use debug in a query and it is a no go(should show at bottom of page). the query is working because I am getting recordcounts. Then...
    3. Returning a Specific number of records...
      I have a query that returns all records in a table... However, I would like to bring back 'n' number of records at a time. For example, the query...
    4. CFQUERY with IF THEN ELSE
      I have a CFQUERY which works perfectly and now I would like to add a little date calculation to this query to filter it little more. The query is a...
    5. Periodically returning no records
      Using Coldfusion MX 6.1, SQL Server 2000: Periodically, a query will return no records, even though it's supposed to return something (verified...
  3. #2

    Default Re: Returning Records from <cfquery>

    Instead of dispaying the whole 300+ records on the single page, only display enough to be viewed without scrolling. Then use pagenation to display the next/previous set of records.

    Ken
    The ScareCrow Guest

  4. #3

    Default Re: Returning Records from <cfquery>

    How do i use pagenation? Is it a feature in CF?


    pnugent Guest

  5. #4

    Default Re: Returning Records from <cfquery>

    No, it's just some code

    At the top of the page

    <!--- row to start output of query result set --->
    <cfparam name="StartRow" default="1">
    <!--- maximum number of rows to display --->
    <cfparam name="MaxRows" defaylt="20">
    <!-- parameter for the previously displayed records --->
    <cfparam name="previous" default="0">
    <!--- parameter for the next set of records to display --->
    <cfparam name="next" default="0">

    Then you have you cfoutput query tag, but you use the startrow and maxrows
    attributes

    <cfoutput query="myQuery" startrow="#startrow#" maxrows="#maxrows#">
    <!--- output query resultset --->
    </cfoutput>

    <!-- set the parameters for the previous/next parameters --->
    <cfset previous = startrow - maxrows>
    <cfset next = startrow + maxrows>

    Then output some links
    <!--- only display the previous link if there is a previous --->
    <cfif previous GT 0>
    <cfoutput>
    <a href="myPage.cfm?startrow=#previous#">Previous #maxrows# records</a>
    </cfoutput>
    </cfif>

    <!--- only display the next link if there are records to display --->
    <cfif next LTE myQuery.RecordCount>
    <cfoutput>
    <a href="myPage.cfm?startrow=#next#">Next #maxrows# records</a>
    </cfoutput>
    </cfif>

    Ken



    The ScareCrow Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139