Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Alphabetical List with indication of Capital Letter


Message #1 by "Strahm Astrid" <info@v...> on Tue, 18 Dec 2001 13:05:15
Hello



Can somebody please help me creating a list of records in 

alphabetical order which indicates also the active capital letter:

e.g like this:



A

Arecord 

Alkdfjkd



B

Bedjf

Brkdlkfj



C

Ckdflkdf

Clkdfjdl



My Problem is not the alphabetical order, but how can I get this Capital 

Letter Above them when a new section beginns? I tried with the "WHERE 

MATCHES Syntax from the ASP 3.0 Book..but always gives me a syntax error.



Thanks very much for any help on this



Astrid

Message #2 by Prakash <anp@a...> on Tue, 18 Dec 2001 19:05:10 +0530
just try out this code....



<%@ Language=VBScript %>

<%

'ASSUME THAT YOU HAVE GOT THE LIST ITEMS OF ARRLIST() FROM DATABASE IN AN ARRAY

WHICH I HAVE MANUALLY ENTERED HERE

Dim Arrlist(15)

count = 15

Arrlist(0) = "anna"

Arrlist(1) = "gouri"

Arrlist(2) = "ramu"

Arrlist(3) = "shree"

Arrlist(4) = "leela"

Arrlist(5) = "kanna"

Arrlist(6) = "ranga"

Arrlist(7) = "honey"

Arrlist(8) = "sweety"

Arrlist(9) = "sungandh"

Arrlist(10) = "tara"

Arrlist(11) = "nita"

Arrlist(12) = "preeti"

Arrlist(13) = "thimma"

Arrlist(14) = "lata"



Arralphabets = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"



arralphabets = split(Arralphabets,",",-1,1)



for each alphabets in arralphabets

 for i = 0 to count

  if left(Arrlist(i),1) = alphabets then

   if check <> alphabets then

   Response.Write "<font size=3>" & ucase(alphabets) & "</font><br>"

   end if

  Response.Write Arrlist(i) & "<br>"

  check = alphabets

  end if

 next

next

%>







Strahm Astrid wrote:



> Hello

>

> Can somebody please help me creating a list of records in

> alphabetical order which indicates also the active capital letter:

> e.g like this:

>

> A

> Arecord

> Alkdfjkd

>

> B

> Bedjf

> Brkdlkfj

>

> C

> Ckdflkdf

> Clkdfjdl

>

> My Problem is not the alphabetical order, but how can I get this Capital

> Letter Above them when a new section beginns? I tried with the "WHERE

> MATCHES Syntax from the ASP 3.0 Book..but always gives me a syntax error.

>

> Thanks very much for any help on this

>

> Astrid

>






Message #3 by "Charles Mabbott" <aa8vs@m...> on Tue, 18 Dec 2001 19:36:36 -0500
An example from book I used............



<%

  Option Explicit

  Dim strConnect

%>

<!-- #include file="DataStore2.asp" -->

<!-- METADATA TYPE="typelib"

              FILE="C:\Program Files\Common Files\System\ado\msado15.dll" 

-->

<HTML>

<!--  Lists by last name into seperate tables

      divided by Block letter of last name

      People not upto date will not be displayed

      Added hot link to QRZ

      Added license class and renewal date

Last update: 10/29/01



      -->

<head>

<TITLE>I 94 Member Complete information page</TITLE>

</HEAD>

<BODY>





<%

  Dim objRS, intLetter, strChar, strCriteria, objcommand, inte



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

  objcommand.activeconnection = strconnect

  objcommand.commandtext = "select * FROM members " & _

          "ORDER by members.lname, members.fname "

   objcommand.commandtype = adcmdtext

   set objrs = objcommand.execute

   set objcommand = nothing

%>

<center><h2>Interstate 94 Members<br>

Detailed List by last name</h1>

<%

    For intLetter = 1 To 26

      strChar = Chr(intLetter+64)

      strCriteria = "Lname LIKE '" & strChar & "*'"

      objRS.Filter = strCriteria

      If Not objRS.EOF Then

        Response.Write "<H2>===========" & strChar & "============</H2>" & _

          "<TABLE BORDER=2 PADDING=5><TR><TD><B>First Name</TD><TD><B>Last 

name</Td><TD><b><center>Call</TD>" & _

          "</td><TD><B><center>License</td><td><center> <b>Renewal 

Date</td></TR>"

          While Not objRS.EOF



           Response.Write "<TR><TD>" & objRS("Fname") & "</TD>" & _

                           "<TD>" & objRS("Lname") & "</TD>" & _

          "<TD><A HREF=""http://www.qrz.com/database?callsign=" & 

objRS("CallID") & "  "">" & objRS("Callid") & "</TD>"  & _

             "<TD>" & objRS("class") & "</td><td>" & objRS("renew") & 

"</td></tr>"



           objRS.MoveNext



          Wend

        Response.Write "</TABLE>"

      End If

    Next



  objRS.Close

  Set objRS = Nothing

%>

<p>

<a href="default.asp#top">Home</a> page

<h3>Last update: 10/29/01</h3>



</center>



</BODY>

</HTML>











>From: Prakash Reply-To: "Access ASP" To: "Access ASP" Subject: [access_asp] 

>Re: Alphabetical List with indication of Capital Letter Date: Tue, 18 Dec 

>2001 19:05:10 +0530

>

>just try out this code....

>

>

>

>

>

>

>Strahm Astrid wrote:

>

> > Hello > > Can somebody please help me creating a list of records in > 

>alphabetical order which indicates also the active capital letter: > e.g 

>like this: > > A > Arecord > Alkdfjkd > > B > Bedjf > Brkdlkfj > > C > 

>Ckdflkdf > Clkdfjdl > > My Problem is not the alphabetical order, but how 

>can I get this Capital > Letter Above them when a new section beginns? I 

>tried with the "WHERE > MATCHES Syntax from the ASP 3.0 Book..but always 

>gives me a syntax error. > > Thanks very much for any help on this > > 

>Astrid > > --- > 

>http://p2p.wrox.com/manager.asp or > 

>$subst('Email.Unsub').

>

>

>--- Change your mail options at http://p2p.wrox.com/manager.asp or to 

>unsubscribe send a blank email to $subst('Email.Unsub').

"Do not meddle in the affairs

of Dragons?. Cuz like you

is crunchy and taste good

with catsup."

- Unknown

http://aa8vs.dhs.org:81/aa8vs



_________________________________________________________________

Join the world?s largest e-mail service with MSN Hotmail. 

http://www.hotmail.com



Message #4 by "Charles Mabbott" <aa8vs@m...> on Tue, 18 Dec 2001 19:41:53 -0500
    For intLetter = 1 To 26

      strChar = Chr(intLetter+64)

      strCriteria = "Lname LIKE '" & strChar & "*'"

      objRS.Filter = strCriteria



      If Not objRS.EOF Then

        Response.Write "<H2>===========" & strChar & "============</H2>" & _

          "<TABLE BORDER=2 PADDING=5><TR><TD><B>First Name</TD><TD><B>Last 

name</Td><TD><b><center>Call</TD>" & _

          "</td><TD><B><center>License</td><td><center> <b>Renewal 

Date</td></TR>"

          While Not objRS.EOF



           Response.Write "<TR><TD>" & objRS("Fname") & "</TD>" & _

                           "<TD>" & objRS("Lname") & "</TD>" & _

          "<TD><A HREF=""http://www.qrz.com/database?callsign=" & 

objRS("CallID") & "  "">" & objRS("Callid") & "</TD>"  & _

             "<TD>" & objRS("class") & "</td><td>" & objRS("renew") & 

"</td></tr>"



           objRS.MoveNext



          Wend

        Response.Write "</TABLE>"

      End If

    Next









>From: "Strahm Astrid" <info@v...>

>Reply-To: "Access ASP" <access_asp@p...>

>To: "Access ASP" <access_asp@p...>

>Subject: [access_asp] Alphabetical List with indication of Capital Letter

>Date: Tue, 18 Dec 2001 13:05:15

>

>Hello

>

>Can somebody please help me creating a list of records in

>alphabetical order which indicates also the active capital letter:

>e.g like this:

>

>A

>Arecord

>Alkdfjkd

>

>B

>Bedjf

>Brkdlkfj

>

>C

>Ckdflkdf

>Clkdfjdl

>

>My Problem is not the alphabetical order, but how can I get this Capital

>Letter Above them when a new section beginns? I tried with the "WHERE

>MATCHES Syntax from the ASP 3.0 Book..but always gives me a syntax error.

>

>Thanks very much for any help on this

>

>Astrid

>














"Do not meddle in the affairs

of Dragons?. Cuz like you

is crunchy and taste good

with catsup."

- Unknown



http://aa8vs.dhs.org:81/aa8vs





_________________________________________________________________

Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.




  Return to Index