Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Recordset is M.I.A.

    I have two pages... a SEARCH.cfm and a RESULTS.cfm

    On the search page I have the form with an action pointing to the results page
    'on submit'... Ok to here!

    On the results page I display the first 5 records from the recordset and then
    give the navigation to view more of the recordset... Ok to here! ( ie:
    Displaying records 1 - 5 of 14 "Next Page Link" " Last Page Link" )
    [using the built in CF Navigation code created by Dreamweaver with a little
    modification]

    But here's where the problem comes in... when I press "Next Page" I lose the
    recordset I searched for and get the complete default recordset for the entire
    query (ie: Browse All) but records 6 - 10 now!
    In my debug, I can see that on any page after page 1, my form variables are
    set to the default parameters I specified.

    To solve this problem, I could re-run the query on each page by passing the
    variables from my search form page to each page on my results loop... But is
    there any other way??
    I can see a problem down the road when the data and
    transaction frequency increase... I don't want to call the SERVER over and over
    again for that query/stored procedure.

    So is my only option to re-run that query on each results page? After
    2 days of Google-ing... I'm spent... help!!!
    This would be so handy to just send a recordset results object or something.

    jboyus Guest

  2. Similar Questions and Discussions

    1. ASP Recordset Help!
      Hi, I have been trying to construct a results page in dreamweaver/asp if i put a search in with one parameter it works fine (ie, select name from...
    2. Using a Recordset
      I'm trying to expand my web design skills by learning how to include some dynamic content in a site. Currently I have an Access database, and...
    3. Is this possible with a recordset?
      Hello, Looking for some expert help. I am using Dreamweaver MX 2004. I have a need that I was wondering if it was possible accomplish using a...
    4. ADO - Recordset
      I was wondering if anyone can help me. I've converting an already existing system (designed in Access which produces reports for the accounts dept)...
    5. RecordSet.Move or RecordSet.AbsolutePosition??
      Hi, I'm trying to use either one of these methods to position the cursor in a specific position inside a recordset, but neither one seems to...
  3. #2

    Default Re: Recordset is M.I.A.

    You can either cache the query or make it a session variable.
    Dan Bracuk Guest

  4. #3

    Default Re: Recordset is M.I.A.

    Yeah... that's what I was afraid of.

    Can you only cache the query for a specific user/session id?

    ....And do you mean make the query a session variable?

    Thanks for your response
    jboyus Guest

  5. #4

    Default Re: Recordset is M.I.A.

    You want to look into using the persistent scopes for this. It is what
    they are made for, the three main scopes are Server, Application, Session.

    Server scoped variables (server.aVar) are accessible by all cfml code on
    the same ColdFusion server.

    Application scoped variables (application.aVar) are accessible by all
    cfml code in the same application.

    Session scoped variables (session.aVar) are accessible to all cfml code
    running in the same session of the same application. This is most
    likely the one you want.

    To use session and application variables, you must use a <cfapplication
    ....> tag to define an application and turn on session management.

    Then in your form action page you can do something like
    <cfset session.searchForm = duplicate(form)>

    Then after that you can refer to all your form varialbes like this
    session.searchFrom.aFieldOne and session.searchForm.aFieldTwo. These
    variables will exist until the user session ends and each user will have
    their own session scope.

    There are occasional issues with this, but if you are not doing anything
    strange with your CF setup, you should not experience these problems.


    jboyus wrote:
    > I have two pages... a SEARCH.cfm and a RESULTS.cfm
    >
    > On the search page I have the form with an action pointing to the results page
    > 'on submit'... Ok to here!
    >
    > On the results page I display the first 5 records from the recordset and then
    > give the navigation to view more of the recordset... Ok to here! ( ie:
    > Displaying records 1 - 5 of 14 "Next Page Link" " Last Page Link" )
    > [using the built in CF Navigation code created by Dreamweaver with a little
    > modification]
    >
    > But here's where the problem comes in... when I press "Next Page" I lose the
    > recordset I searched for and get the complete default recordset for the entire
    > query (ie: Browse All) but records 6 - 10 now!
    > In my debug, I can see that on any page after page 1, my form variables are
    > set to the default parameters I specified.
    >
    > To solve this problem, I could re-run the query on each page by passing the
    > variables from my search form page to each page on my results loop... But is
    > there any other way??
    I can see a problem down the road when the data and
    > transaction frequency increase... I don't want to call the SERVER over and over
    > again for that query/stored procedure.
    >
    > So is my only option to re-run that query on each results page? After
    > 2 days of Google-ing... I'm spent... help!!!
    > This would be so handy to just send a recordset results object or something.
    >
    Ian Skinner Guest

  6. #5

    Default Re: Recordset is M.I.A.

    I love it... solution found! thanks to all
    jboyus Guest

  7. #6

    Default Re: Recordset is M.I.A.

    You can cache any query but since you would have to preserve some other variables anyhow, making the query a session variable gives you the same result with less code.

    That would be my apporoach.
    Dan Bracuk 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