Ask a Question related to Coldfusion Database Access, Design and Development.
-
jboyus #1
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
-
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... -
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... -
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... -
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)... -
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... -
Dan Bracuk #2
Re: Recordset is M.I.A.
You can either cache the query or make it a session variable.
Dan Bracuk Guest
-
jboyus #3
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
-
Ian Skinner #4
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
-
-
Dan Bracuk #6
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



Reply With Quote

