Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: changing the order of db cats on a web admin interface asp page


Message #1 by "adam" <adam_hw@k...> on Tue, 26 Nov 2002 14:51:09
Hi there 

I have a very simple sql statement below:

SELECT pc.CategoryShort FROM ProductCategories pc WHERE pc.TV = '1'

However I need to be able to alter the order of the categories when I need 
to ( which could be daily/weekly/twice daily/twice weekly ). The point is 
that I have to have the ability to change the order of the categories 
whenever I want from a web interface.  If someone could point me in the 
right direction as to where to start building this process I would be very 
grateful.

thanks in anticipation.

Adam
Message #2 by Geoff Hankerson <ghank@l...> on Tue, 26 Nov 2002 09:20:27 -0600
How about a  form that lets you choose different sorting option which 
then dynamically  gets added to the sql statement

<form method="post">
    <select name="sortorder">
        <option name="descending" value="DESC">
         <option name="ascending" value="ASC">
        <!-- add more option as needed -->
    </select>
     
</form>

then on the response page
Dim sql
sql ="SELECT pc.CategoryShort FROM ProductCategories pc WHERE pc.TV = 
'1' ORDER BY pc.CategoryShort "
sql = sql & request.form("sortorder")

THis is not real tested code just there to give you an idea
adam wrote:

>Hi there 
>
>I have a very simple sql statement below:
>
>SELECT pc.CategoryShort FROM ProductCategories pc WHERE pc.TV = '1'
>
>However I need to be able to alter the order of the categories when I need 
>to ( which could be daily/weekly/twice daily/twice weekly ). The point is 
>that I have to have the ability to change the order of the categories 
>whenever I want from a web interface.  If someone could point me in the 
>right direction as to where to start building this process I would be very 
>grateful.
>
>thanks in anticipation.
>
>Adam
> 
>To unsubscribe send a blank email to %%email.unsub%%
>
>
>  
>


Message #3 by "Adam H-W" <adam_hw@k...> on Tue, 26 Nov 2002 15:29:02 -0000
thanks Geoff,

Will give it a go


Tel: 0208 877 0077
Fax: 0208 874 7851
adam_hw@k...
----- Original Message -----
From: "Geoff Hankerson" <ghank@l...>
To: "ASP components" <asp_components@p...>
Sent: Tuesday, November 26, 2002 3:20 PM
Subject: [asp_components] Re: changing the order of db cats on a web admin
interface asp page


> How about a  form that lets you choose different sorting option which
> then dynamically  gets added to the sql statement
>
> <form method="post">
>     <select name="sortorder">
>         <option name="descending" value="DESC">
>          <option name="ascending" value="ASC">
>         <!-- add more option as needed -->
>     </select>
>
> </form>
>
> then on the response page
> Dim sql
> sql ="SELECT pc.CategoryShort FROM ProductCategories pc WHERE pc.TV 
> '1' ORDER BY pc.CategoryShort "
> sql = sql & request.form("sortorder")
>
> THis is not real tested code just there to give you an idea
> adam wrote:
>
> >Hi there
> >
> >I have a very simple sql statement below:
> >
> >SELECT pc.CategoryShort FROM ProductCategories pc WHERE pc.TV = '1'
> >
> >However I need to be able to alter the order of the categories when I
need
> >to ( which could be daily/weekly/twice daily/twice weekly ). The point is
> >that I have to have the ability to change the order of the categories
> >whenever I want from a web interface.  If someone could point me in the
> >right direction as to where to start building this process I would be
very
> >grateful.
> >
> >thanks in anticipation.
> >
> >Adam
> >
> >To unsubscribe send a blank email to %%email.unsub%%
> >
> >
> >
> >
>
>
>
>
%%email.unsub%%
>
>



Message #4 by "Adrian Forbes" <adrian.forbes@n...> on Tue, 26 Nov 2002 15:28:30 -0000
Add a "Sequence" field to the table and ORDER BY that.  To change the order
you just update the sequence numbers.

-----Original Message-----
From: adam [mailto:adam_hw@k...]
Sent: Tuesday, November 26, 2002 2:51 PM
To: ASP components
Subject: [asp_components] changing the order of db cats on a web admin
interface asp page


Hi there

I have a very simple sql statement below:

SELECT pc.CategoryShort FROM ProductCategories pc WHERE pc.TV = '1'

However I need to be able to alter the order of the categories when I need
to ( which could be daily/weekly/twice daily/twice weekly ). The point is
that I have to have the ability to change the order of the categories
whenever I want from a web interface.  If someone could point me in the
right direction as to where to start building this process I would be very
grateful.

thanks in anticipation.

Adam

%%email.unsub%%



  Return to Index