Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Re: Sortable Table


Message #1 by "Drew, Ron" <RDrew@B...> on Mon, 10 Jun 2002 10:14:23 -0400
If you rerun the query based on a variable in the querystring, just test
for the not null variable being passed and do the ORDER BY on only that
variable.  Do you ever have multiple sorts (2 variables)?

-----Original Message-----
From: Joseph Coppola [mailto:joco@e...]
Sent: Thursday, June 06, 2002 11:06 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Sortable Table


Can you explain this:
I make my header columns a link to the same page,
passing in the field name to sort in the querystring.
I then rerun the query and look for the var passed in
the querystring.  If it's there, I sort the data in
the recordset using the above line of code.  Viola!

How do you pass in the field name?  Do you need to use session variable?
Do you think its better to use session variables rather than hidden
fields?

Thanks!
Joe

-----Original Message-----
From: Mark Eckeard [mailto:meckeard2000@y...]
Sent: Thursday, June 06, 2002 10:58 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Sortable Table


Joseph,

You can use session variables to store the original
form values.

And as far as sorting, ADO can sort data after it's
returned from the DB.  Like this:

ObjRS.Sort=3D"" & strSQLSortBy & ""

(strSQLSortBy would be one of your fields in the
recordset)

I make my header columns a link to the same page,
passing in the field name to sort in the querystring.
I then rerun the query and look for the var passed in
the querystring.  If it's there, I sort the data in
the recordset using the above line of code.  Viola!

Mark.


--- Joseph Coppola <joco@e...> wrote:
> I have created a page that searches a database based
> on a form.  The
> results
> are called in a new window.  However, I would like
> to have the results
> to be
> dynamically sorted, (ie through the column
> headings).  Does anyone have
> a
> good way to do this?
>
> The problem I am running into is that my main form
> calls the ASP page,
> and
> then the ASP page Requests the values from the combo
> boxes.  However,
> when I
> resort the page I need to be able to process the
> same SQL statement with
> variables as before, except I need an new Order BY
> statement.  Is there
> a
> way to store the values from the last FORM ACTION,
> so that I can use
> them
> again?
>
> I know I can use HIDDEN INPUTS but I am cannot
> figure how to use the
> HIDDEN INPUTS on a reprocess of the same ASP page. Considering there
> is no form that is being resubmitted.
>
> Any ideas?
>
> Joe
>
>
>
> ---
>
> Improve your web design skills with these new books
> from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> r-20


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #2 by Jack_Speranza <jsperanza@g...> on Fri, 7 Jun 2002 09:27:28 -0400
If you're looking for a non-ASP solution and aren't worried about supporting
pre-IE 5 and Netscape 6 browsers, then you can easily accomplish this on the
client side using the DOM (no extra calls to the server... )

-----Original Message-----
From: Joseph Coppola [mailto:joco@e...]
Sent: Thursday, June 06, 2002 11:06 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Sortable Table


Can you explain this:
I make my header columns a link to the same page,
passing in the field name to sort in the querystring. 
I then rerun the query and look for the var passed in
the querystring.  If it's there, I sort the data in
the recordset using the above line of code.  Viola!

How do you pass in the field name?  Do you need to use session variable?
Do you think its better to use session variables rather than hidden
fields?

Thanks!
Joe

-----Original Message-----
From: Mark Eckeard [mailto:meckeard2000@y...] 
Sent: Thursday, June 06, 2002 10:58 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Sortable Table


Joseph,

You can use session variables to store the original
form values.

And as far as sorting, ADO can sort data after it's
returned from the DB.  Like this:

ObjRS.Sort="" & strSQLSortBy & ""

(strSQLSortBy would be one of your fields in the
recordset)

I make my header columns a link to the same page,
passing in the field name to sort in the querystring. 
I then rerun the query and look for the var passed in
the querystring.  If it's there, I sort the data in
the recordset using the above line of code.  Viola!

Mark.


--- Joseph Coppola <joco@e...> wrote:
> I have created a page that searches a database based
> on a form.  The
> results
> are called in a new window.  However, I would like
> to have the results
> to be
> dynamically sorted, (ie through the column
> headings).  Does anyone have
> a
> good way to do this?
> 
> The problem I am running into is that my main form
> calls the ASP page,
> and
> then the ASP page Requests the values from the combo
> boxes.  However,
> when I
> resort the page I need to be able to process the
> same SQL statement with
> variables as before, except I need an new Order BY
> statement.  Is there
> a
> way to store the values from the last FORM ACTION,
> so that I can use
> them
> again?
> 
> I know I can use HIDDEN INPUTS but I am cannot
> figure how to use the
> HIDDEN INPUTS on a reprocess of the same ASP page. Considering there 
> is no form that is being resubmitted.
> 
> Any ideas?
> 
> Joe
> 
> 
> 
> ---
> 
> Improve your web design skills with these new books
> from Glasshaus.
> 
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #3 by Shaun Steckley <SSTECKLEY@P...> on Fri, 7 Jun 2002 09:30:28 -0400
I have implemented a very similar type of application where I give the user
the ability to sort a table simply by clicking on the table headers.  I did
this by creating a XML file from the database query, then running the XML
through a XSL page to display the content.  XSL makes sorting and displaying
XML really nice.  Not as complicated as it sounds...

Shaun

-----Original Message-----
From: Jack_Speranza [mailto:jsperanza@g...]
Sent: Friday, June 07, 2002 9:27 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Sortable Table


If you're looking for a non-ASP solution and aren't worried about supporting
pre-IE 5 and Netscape 6 browsers, then you can easily accomplish this on the
client side using the DOM (no extra calls to the server... )

-----Original Message-----
From: Joseph Coppola [mailto:joco@e...]
Sent: Thursday, June 06, 2002 11:06 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Sortable Table


Can you explain this:
I make my header columns a link to the same page,
passing in the field name to sort in the querystring. 
I then rerun the query and look for the var passed in
the querystring.  If it's there, I sort the data in
the recordset using the above line of code.  Viola!

How do you pass in the field name?  Do you need to use session variable?
Do you think its better to use session variables rather than hidden
fields?

Thanks!
Joe

-----Original Message-----
From: Mark Eckeard [mailto:meckeard2000@y...] 
Sent: Thursday, June 06, 2002 10:58 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Sortable Table


Joseph,

You can use session variables to store the original
form values.

And as far as sorting, ADO can sort data after it's
returned from the DB.  Like this:

ObjRS.Sort="" & strSQLSortBy & ""

(strSQLSortBy would be one of your fields in the
recordset)

I make my header columns a link to the same page,
passing in the field name to sort in the querystring. 
I then rerun the query and look for the var passed in
the querystring.  If it's there, I sort the data in
the recordset using the above line of code.  Viola!

Mark.


--- Joseph Coppola <joco@e...> wrote:
> I have created a page that searches a database based
> on a form.  The
> results
> are called in a new window.  However, I would like
> to have the results
> to be
> dynamically sorted, (ie through the column
> headings).  Does anyone have
> a
> good way to do this?
> 
> The problem I am running into is that my main form
> calls the ASP page,
> and
> then the ASP page Requests the values from the combo
> boxes.  However,
> when I
> resort the page I need to be able to process the
> same SQL statement with
> variables as before, except I need an new Order BY
> statement.  Is there
> a
> way to store the values from the last FORM ACTION,
> so that I can use
> them
> again?
> 
> I know I can use HIDDEN INPUTS but I am cannot
> figure how to use the
> HIDDEN INPUTS on a reprocess of the same ASP page. Considering there 
> is no form that is being resubmitted.
> 
> Any ideas?
> 
> Joe
> 
> 
> 
> ---
> 
> Improve your web design skills with these new books
> from Glasshaus.
> 
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


********************************************************************
The information contained in this email is confidential and
is intended solely for the use of the person identified and
intended as the recipient. If you are not the intended 
recipient, any disclosure, copying, distribution, or taking of
any action in reliance on the contents is prohibited. If you
receive this message in error, contact the sender
immediately and delete it from your computer.

Personal e-mails are restricted by PSECU policy. As such,
PSECU specifically disclaims any responsibility or liability
for any personal information or opinions of the author
expressed in this email.
********************************************************************

Message #4 by Mark Eckeard <meckeard2000@y...> on Fri, 7 Jun 2002 05:17:33 -0700 (PDT)
Actually, Ken's point is a good one.  If you do have
the ability to pass in a parameter in your query that
will sort the data, then do it.  The work should be
done in the database.  In my case, I did not so I have
to improvise.


--- Ken Schaefer <ken@a...> wrote:
> a) I would not use the Recordset's .Sort method - it
> is a sucky way of
> sorting a recordset. Better to have the database
> return an ordered resultset
> in the first place
> 
> b) You are getting someone to submit the search
> criteria in the first
> place - since the server is going to have the grab
> them anyway, why not just
> "re-pass" them in the query string along with the
> field to be ordered by. If
> you think this is making your URLs look ugly, just
> use a cookie. Don't use
> session variables to store something that doesn't
> really need to be
> server-side persisted - a client-side cookie is more
> than sufficient.
> 
> Cheers
> Ken
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: "Joseph Coppola" <joco@e...>
> Subject: [asp_web_howto] Re: Sortable Table
> 
> 
> : Can you explain this:
> : I make my header columns a link to the same page,
> : passing in the field name to sort in the
> querystring.
> : I then rerun the query and look for the var passed
> in
> : the querystring.  If it's there, I sort the data
> in
> : the recordset using the above line of code. 
> Viola!
> :
> : How do you pass in the field name?  Do you need to
> use session variable?
> : Do you think its better to use session variables
> rather than hidden
> : fields?
> :
> : Thanks!
> : Joe
> :
> : -----Original Message-----
> : From: Mark Eckeard [mailto:meckeard2000@y...]
> : Sent: Thursday, June 06, 2002 10:58 PM
> : To: ASP Web HowTo
> : Subject: [asp_web_howto] Re: Sortable Table
> :
> :
> : Joseph,
> :
> : You can use session variables to store the
> original
> : form values.
> :
> : And as far as sorting, ADO can sort data after
> it's
> : returned from the DB.  Like this:
> :
> : ObjRS.Sort="" & strSQLSortBy & ""
> :
> : (strSQLSortBy would be one of your fields in the
> : recordset)
> :
> : I make my header columns a link to the same page,
> : passing in the field name to sort in the
> querystring.
> : I then rerun the query and look for the var passed
> in
> : the querystring.  If it's there, I sort the data
> in
> : the recordset using the above line of code. 
> Viola!
> :
> : Mark.
> :
> :
> : --- Joseph Coppola <joco@e...> wrote:
> : > I have created a page that searches a database
> based
> : > on a form.  The
> : > results
> : > are called in a new window.  However, I would
> like
> : > to have the results
> : > to be
> : > dynamically sorted, (ie through the column
> : > headings).  Does anyone have
> : > a
> : > good way to do this?
> : >
> : > The problem I am running into is that my main
> form
> : > calls the ASP page,
> : > and
> : > then the ASP page Requests the values from the
> combo
> : > boxes.  However,
> : > when I
> : > resort the page I need to be able to process the
> : > same SQL statement with
> : > variables as before, except I need an new Order
> BY
> : > statement.  Is there
> : > a
> : > way to store the values from the last FORM
> ACTION,
> : > so that I can use
> : > them
> : > again?
> : >
> : > I know I can use HIDDEN INPUTS but I am cannot
> : > figure how to use the
> : > HIDDEN INPUTS on a reprocess of the same ASP
> page. Considering there
> : > is no form that is being resubmitted.
> : >
> : > Any ideas?
> : >
> : > Joe
> : >
> : >
> : >
> : > ---
> : >
> : > Improve your web design skills with these new
> books
> : > from Glasshaus.
> : >
> : > Usable Web Menus
> : >
> :
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> : > r-20
> : > Constructing Accessible Web Sites
> : >
> :
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> : > r-20
> : > Practical JavaScript for the Usable Web
> : >
> :
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> : > r-20
> :
> :
> : __________________________________________________
> : Do You Yahoo!?
> : Yahoo! - Official partner of 2002 FIFA World Cup
> : http://fifaworldcup.yahoo.com
> :
> :
> : ---
> :
> : Improve your web design skills with these new
> books from Glasshaus.
> :
> : Usable Web Menus
> :
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> : r-20
> : Constructing Accessible Web Sites
> :
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> : r-20
> : Practical JavaScript for the Usable Web
> :
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> : r-20
> :
> :
> :
> : ---
> :
> : Improve your web design skills with these new
> books from Glasshaus.
> :
> : Usable Web Menus
> :
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> : r-20
> : Constructing Accessible Web Sites
> :
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> : r-20
> : Practical JavaScript for the Usable Web
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
Message #5 by "Ken Schaefer" <ken@a...> on Fri, 7 Jun 2002 17:18:03 +1000
a) I would not use the Recordset's .Sort method - it is a sucky way of
sorting a recordset. Better to have the database return an ordered resultset
in the first place

b) You are getting someone to submit the search criteria in the first
place - since the server is going to have the grab them anyway, why not just
"re-pass" them in the query string along with the field to be ordered by. If
you think this is making your URLs look ugly, just use a cookie. Don't use
session variables to store something that doesn't really need to be
server-side persisted - a client-side cookie is more than sufficient.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Joseph Coppola" <joco@e...>
Subject: [asp_web_howto] Re: Sortable Table


: Can you explain this:
: I make my header columns a link to the same page,
: passing in the field name to sort in the querystring.
: I then rerun the query and look for the var passed in
: the querystring.  If it's there, I sort the data in
: the recordset using the above line of code.  Viola!
:
: How do you pass in the field name?  Do you need to use session variable?
: Do you think its better to use session variables rather than hidden
: fields?
:
: Thanks!
: Joe
:
: -----Original Message-----
: From: Mark Eckeard [mailto:meckeard2000@y...]
: Sent: Thursday, June 06, 2002 10:58 PM
: To: ASP Web HowTo
: Subject: [asp_web_howto] Re: Sortable Table
:
:
: Joseph,
:
: You can use session variables to store the original
: form values.
:
: And as far as sorting, ADO can sort data after it's
: returned from the DB.  Like this:
:
: ObjRS.Sort="" & strSQLSortBy & ""
:
: (strSQLSortBy would be one of your fields in the
: recordset)
:
: I make my header columns a link to the same page,
: passing in the field name to sort in the querystring.
: I then rerun the query and look for the var passed in
: the querystring.  If it's there, I sort the data in
: the recordset using the above line of code.  Viola!
:
: Mark.
:
:
: --- Joseph Coppola <joco@e...> wrote:
: > I have created a page that searches a database based
: > on a form.  The
: > results
: > are called in a new window.  However, I would like
: > to have the results
: > to be
: > dynamically sorted, (ie through the column
: > headings).  Does anyone have
: > a
: > good way to do this?
: >
: > The problem I am running into is that my main form
: > calls the ASP page,
: > and
: > then the ASP page Requests the values from the combo
: > boxes.  However,
: > when I
: > resort the page I need to be able to process the
: > same SQL statement with
: > variables as before, except I need an new Order BY
: > statement.  Is there
: > a
: > way to store the values from the last FORM ACTION,
: > so that I can use
: > them
: > again?
: >
: > I know I can use HIDDEN INPUTS but I am cannot
: > figure how to use the
: > HIDDEN INPUTS on a reprocess of the same ASP page. Considering there
: > is no form that is being resubmitted.
: >
: > Any ideas?
: >
: > Joe
: >
: >
: >
: > ---
: >
: > Improve your web design skills with these new books
: > from Glasshaus.
: >
: > Usable Web Menus
: >
: http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
: > r-20
: > Constructing Accessible Web Sites
: >
: http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
: > r-20
: > Practical JavaScript for the Usable Web
: >
: http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
: > r-20
:
:
: __________________________________________________
: Do You Yahoo!?
: Yahoo! - Official partner of 2002 FIFA World Cup
: http://fifaworldcup.yahoo.com
:
:
: ---
:
: Improve your web design skills with these new books from Glasshaus.
:
: Usable Web Menus
: http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
: r-20
: Constructing Accessible Web Sites
: http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
: r-20
: Practical JavaScript for the Usable Web
: http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
: r-20
:
:
:
: ---
:
: Improve your web design skills with these new books from Glasshaus.
:
: Usable Web Menus
: http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
: r-20
: Constructing Accessible Web Sites
: http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
: r-20
: Practical JavaScript for the Usable Web
: http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
: r-20

Message #6 by Joseph Coppola <joco@e...> on Thu, 06 Jun 2002 23:05:40 -0400
Can you explain this:
I make my header columns a link to the same page,
passing in the field name to sort in the querystring. 
I then rerun the query and look for the var passed in
the querystring.  If it's there, I sort the data in
the recordset using the above line of code.  Viola!

How do you pass in the field name?  Do you need to use session variable?
Do you think its better to use session variables rather than hidden
fields?

Thanks!
Joe

-----Original Message-----
From: Mark Eckeard [mailto:meckeard2000@y...] 
Sent: Thursday, June 06, 2002 10:58 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Sortable Table


Joseph,

You can use session variables to store the original
form values.

And as far as sorting, ADO can sort data after it's
returned from the DB.  Like this:

ObjRS.Sort="" & strSQLSortBy & ""

(strSQLSortBy would be one of your fields in the
recordset)

I make my header columns a link to the same page,
passing in the field name to sort in the querystring. 
I then rerun the query and look for the var passed in
the querystring.  If it's there, I sort the data in
the recordset using the above line of code.  Viola!

Mark.


--- Joseph Coppola <joco@e...> wrote:
> I have created a page that searches a database based
> on a form.  The
> results
> are called in a new window.  However, I would like
> to have the results
> to be
> dynamically sorted, (ie through the column
> headings).  Does anyone have
> a
> good way to do this?
> 
> The problem I am running into is that my main form
> calls the ASP page,
> and
> then the ASP page Requests the values from the combo
> boxes.  However,
> when I
> resort the page I need to be able to process the
> same SQL statement with
> variables as before, except I need an new Order BY
> statement.  Is there
> a
> way to store the values from the last FORM ACTION,
> so that I can use
> them
> again?
> 
> I know I can use HIDDEN INPUTS but I am cannot
> figure how to use the
> HIDDEN INPUTS on a reprocess of the same ASP page. Considering there 
> is no form that is being resubmitted.
> 
> Any ideas?
> 
> Joe
> 
> 
> 
> ---
> 
> Improve your web design skills with these new books
> from Glasshaus.
> 
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

Message #7 by Mark Eckeard <meckeard2000@y...> on Thu, 6 Jun 2002 19:57:41 -0700 (PDT)
Joseph,

You can use session variables to store the original
form values.

And as far as sorting, ADO can sort data after it's
returned from the DB.  Like this:

ObjRS.Sort="" & strSQLSortBy & ""

(strSQLSortBy would be one of your fields in the
recordset)

I make my header columns a link to the same page,
passing in the field name to sort in the querystring. 
I then rerun the query and look for the var passed in
the querystring.  If it's there, I sort the data in
the recordset using the above line of code.  Viola!

Mark.


--- Joseph Coppola <joco@e...> wrote:
> I have created a page that searches a database based
> on a form.  The
> results
> are called in a new window.  However, I would like
> to have the results
> to be
> dynamically sorted, (ie through the column
> headings).  Does anyone have
> a
> good way to do this?
> 
> The problem I am running into is that my main form
> calls the ASP page,
> and
> then the ASP page Requests the values from the combo
> boxes.  However,
> when I
> resort the page I need to be able to process the
> same SQL statement with
> variables as before, except I need an new Order BY
> statement.  Is there
> a
> way to store the values from the last FORM ACTION,
> so that I can use
> them
> again?
> 
> I know I can use HIDDEN INPUTS but I am cannot
> figure how to use the
> HIDDEN INPUTS on a reprocess of the same ASP page.
> Considering there is
> no form that is being resubmitted.
> 
> Any ideas?
> 
> Joe
> 
> 
> 
> ---
> 
> Improve your web design skills with these new books
> from Glasshaus.
> 
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
Message #8 by Joseph Coppola <joco@e...> on Thu, 06 Jun 2002 22:15:17 -0400
I have created a page that searches a database based on a form.  The
results
are called in a new window.  However, I would like to have the results
to be
dynamically sorted, (ie through the column headings).  Does anyone have
a
good way to do this?

The problem I am running into is that my main form calls the ASP page,
and
then the ASP page Requests the values from the combo boxes.  However,
when I
resort the page I need to be able to process the same SQL statement with
variables as before, except I need an new Order BY statement.  Is there
a
way to store the values from the last FORM ACTION, so that I can use
them
again?

I know I can use HIDDEN INPUTS but I am cannot figure how to use the
HIDDEN INPUTS on a reprocess of the same ASP page. Considering there is
no form that is being resubmitted.

Any ideas?

Joe


  Return to Index