navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

A to Z Directory - Displaying Data that Starts with a Number

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> A to Z Directory - Displaying Data that Starts with a Number
Page: [1]
 
mcomer

 

Posts: 5
Joined: 5/20/2006
Status: offline

 
A to Z Directory - Displaying Data that Starts with a N... - 5/25/2006 22:43:31   
Hi Again,

I'm creating an A-Z directory of company names. Some of these names start with numbers, so I'd like to display the following links across the top of the page:

# A B C D E F....

Below these links, I'd list the company names as a user clicks on a letter. When a company name starts with a letter, I have no problem, but when someone clicks on the "#", I want to list all company names that start with a number. How do I do this?

Any help would be much appreciated!

Thanks!

Mike :)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: A to Z Directory - Displaying Data that Starts with... - 5/26/2006 0:05:35   
What have you got so far? Does the click of a link execute a new query based on the letter clicked?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to mcomer)
mcomer

 

Posts: 5
Joined: 5/20/2006
Status: offline

 
RE: A to Z Directory - Displaying Data that Starts with... - 5/26/2006 0:13:26   
Hi Duane,

Thanks for the reply! Each link passes a parameter... A, when clicked refreshes the page and passes the parameter A. The results display everything that starts with A. The same thing happens with B and C and so on...

For now, when "#" is clicked, I just pass the word number (until I figure out how to handle it).

The code is long and ugly, but here it is...

						<tr>
							<td height="21">
							<p align="center"><b><font size="2" face="Tahoma">
							<a href="manufacturer-directory.asp?ms=number">#</a> 
							<a href="manufacturer-directory.asp?ms=a">A</a> 
							<a href="manufacturer-directory.asp?ms=b">B</a> 
							<a href="manufacturer-directory.asp?ms=c">C</a> 
							<a href="manufacturer-directory.asp?ms=d">D</a> 
							<a href="manufacturer-directory.asp?ms=e">E</a> 
							<a href="manufacturer-directory.asp?ms=f">F</a> 
							<a href="manufacturer-directory.asp?ms=g">G</a> 
							<a href="manufacturer-directory.asp?ms=h">H</a> 
							<a href="manufacturer-directory.asp?ms=i">I</a> 
							<a href="manufacturer-directory.asp?ms=j">J</a> 
							<a href="manufacturer-directory.asp?ms=k">K</a> 
							<a href="manufacturer-directory.asp?ms=l">L</a> 
							<a href="manufacturer-directory.asp?ms=m">M</a> 
							<a href="manufacturer-directory.asp?ms=n">N</a> 
							<a href="manufacturer-directory.asp?ms=o">O</a> 
							<a href="manufacturer-directory.asp?ms=p">P</a> 
							<a href="manufacturer-directory.asp?ms=q">Q</a> 
							<a href="manufacturer-directory.asp?ms=r">R</a> 
							<a href="manufacturer-directory.asp?ms=s">S</a> 
							<a href="manufacturer-directory.asp?ms=t">T</a> 
							<a href="manufacturer-directory.asp?ms=u">U</a> 
							<a href="manufacturer-directory.asp?ms=v">V</a> 
							<a href="manufacturer-directory.asp?ms=w">W</a> 
							<a href="manufacturer-directory.asp?ms=x">X</a> 
							<a href="manufacturer-directory.asp?ms=y">Y</a> 
							<a href="manufacturer-directory.asp?ms=z">Z</a></font></b></td>
						</tr>
						<tr>
							<td>
							 </td>
						</tr>
						<tr>
							<td>
							<table width="100%" cellspacing="0" cellpadding="2">
	<tbody>
		<!--webbot bot="DatabaseRegionStart" s-columnnames="mfg_lt_name,mfg_id,mfg_name,mfg_address1,mfg_address2,mfg_address3,mfg_city,mfg_state,mfg_zip,mfg_country,mfg_tel_tf,mfg_tel,mfg_fax,mfg_email,mfg_url,mfg_logo_url,mfg_logo_alt,mfg_intro_text,mfg_intro_image_url,mfg_intro_image_alt,mfg_intro_link1_title,mfg_intro_link1_url,mfg_intro_link2_title,mfg_intro_link2_url,mfg_intro_link3_title,mfg_intro_link3_url,mfg_active_date,mfg_listing_type" s-columntypes="200,3,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,135,3" s-dataconnection="database" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice="mfg_name" s-menuvalue="mfg_name" b-tableborder="FALSE" b-tableexpand="TRUE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="mfg_az_view" s-displaycolumns="mfg_name" s-criteria="[mfg_name] BEG {ms} +" s-order="[mfg_listing_type] + [mfg_name] +" s-sql="SELECT * FROM mfg_az_view WHERE (mfg_name LIKE '::ms::%') ORDER BY mfg_listing_type ASC,mfg_name ASC" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="ms=skjdfjehvufdfv" s-norecordsfound="" i-maxrecords="0" i-groupsize="0" botid="1" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.</font></td></tr>" startspan b-UseDotNET="FALSE" CurrentExt sa-InputTypes="200" b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes="200" b-WasTableFormat="TRUE" --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM mfg_az_view WHERE (mfg_name LIKE '::ms::%') ORDER BY mfg_listing_type ASC,mfg_name ASC"
fp_sDefault="ms=skjdfjehvufdfv"
fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%""></td></tr>"
fp_sDataConn="database"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="mfg_name"
fp_sMenuValue="mfg_name"
fp_sColTypes="&mfg_lt_name=200&mfg_id=3&mfg_name=200&mfg_address1=200&mfg_address2=200&mfg_address3=200&mfg_city=200&mfg_state=200&mfg_zip=200&mfg_country=200&mfg_tel_tf=200&mfg_tel=200&mfg_fax=200&mfg_email=200&mfg_url=200&mfg_logo_url=200&mfg_logo_alt=200&mfg_intro_text=200&mfg_intro_image_url=200&mfg_intro_image_alt=200&mfg_intro_link1_title=200&mfg_intro_link1_url=200&mfg_intro_link2_title=200&mfg_intro_link2_url=200&mfg_intro_link3_title=200&mfg_intro_link3_url=200&mfg_active_date=135&mfg_listing_type=3&"
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="52691" --><tr>
<%
DIM GroupName,tmpGroupName
GroupName=FP_FieldVal(fp_rs,"mfg_listing_type")
If GroupName <> tmpGroupName then
tmpGroupName=GroupName
%>
<td height="21" style="border-color: DarkGray; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px" bgcolor="#F3F3F7">
<b>
<font face="Tahoma" size="2"><%=FP_FieldVal(fp_rs,"mfg_lt_name")%> Manufacturing 
Members</font></b></td>
</tr>
<tr>
<%end if%><td height="41" style="border-bottom-style: none; border-bottom-width: medium; " valign="middle"><font size="2" face="Tahoma">
<%
If FP_FieldVal(fp_rs,"mfg_listing_type")=1 then
%>
<b><%=FP_FieldVal(fp_rs,"mfg_name")%></b><br>
<%
Else
%>
<%=FP_FieldVal(fp_rs,"mfg_name")%><br>
<% End If %>
<a href="mfg-intro.asp?m=<%=FP_FieldURL(fp_rs,"mfg_id")%>">View Profile</a>
<%
If FP_FieldVal(fp_rs,"mfg_listing_type")<>1 then
Else
%>
<font color="#C0C0C0">-</font>
<a target="_blank" href="<%=FP_FieldLink(fp_rs,"mfg_url")%>">View Website</a></font>
<% 
End If 
%>
</td>
		</tr>
<tr>
<td height="1" style="border-bottom-style: none; border-bottom-width: medium" background="images/dash2.gif">
<img border="0" src="images/1pxl.gif" width="1" height="1"></td>
		</tr>
		<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
</table>
</td>


(in reply to BeTheBall)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: A to Z Directory - Displaying Data that Starts with... - 5/26/2006 9:12:21   
You're using a DRW which will mean you'll need to do something like this:

<%
IF request.querystring("ms") = "number" THEN
fp_sQry="SELECT * FROM mfg_az_view WHERE (mfg_name < 'a') AND (mfg_name > '') ORDER BY mfg_listing_type ASC,mfg_name ASC"

ELSE
fp_sQry="SELECT * FROM mfg_az_view WHERE (mfg_name LIKE '::ms::%') ORDER BY mfg_listing_type ASC,mfg_name ASC"
END IF
fp_sDefault="ms=skjdfjehvufdfv"
...

That help any?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to mcomer)
mcomer

 

Posts: 5
Joined: 5/20/2006
Status: offline

 
RE: A to Z Directory - Displaying Data that Starts with... - 5/26/2006 9:54:38   
That helps a lot! Works perfectly...

Thanks!

Mike

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> A to Z Directory - Displaying Data that Starts with a Number
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts