Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Sort list by clicking on header


Message #1 by "Sverrir Gunnlaugsson" <sverrir01@r...> on Mon, 24 Sep 2001 17:15:14 -0000
I'm new to ASP/SQL and I'm wondering about sorting a list by clicking on

the header of a table.



Can someone point me in the right direction.

I'm not sure how to get the sort option or use it.

I'm using Access2000.



Name     Address     

John     Road 6

Paul     Bay 5

Peter    Street 10

Mary     Baker 6



My first guess was that it would be an

if sentence



if sort by name ASC

   a href=3Dpage?name=3DDESC



else

    a href=3Dpage?name=3DASC



Hope you can help.



Thanks in advance.

Sverrir

Message #2 by "Charles Mabbott" <aa8vs@m...> on Mon, 24 Sep 2001 15:39:45 -0400
The following worked in ASP for me!

Set objcommand =3D Server.CreateObject("ADODB.command")

objcommand.activeconnection =3D strconnect

objcommand.commandtext =3D "select members.callid, members.lname, members

.fname " & _

"FROM members " & _

"ORDER by members.lname, members.fname "

objcommand.commandtype =3D adcmdtext

set objrs =3D objcommand.execute

set objcommand =3D nothing

 

 

----- Original Message -----

From: Sverrir Gunnlaugsson

Sent: Monday, September 24, 2001 1:31 PM

To: Access ASP

Subject: [access_asp] Sort list by clicking on header

 

I'm new to ASP/SQL and I'm wondering about sorting a list by clicking on

the header of a table.



Can someone point me in the right direction.

I'm not sure how to get the sort option or use it.

I'm using Access2000.



Name     Address      

John     Road 6

Paul     Bay 5

Peter    Street 10

Mary     Baker 6



My first guess was that it would be an

if sentence



if sort by name ASC

   a href=3Dpage?name=3DDESC



else

    a href=3Dpage?name=3DASC



Hope you can help.



Thanks in advance.

Sverrir




  Return to Index