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

 

Using % to show all results

 
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 >> Using % to show all results
Page: [1]
 
A1234

 

Posts: 101
Joined: 10/7/2004
Status: offline

 
Using % to show all results - 3/9/2005 8:41:44   
I forgot how to do this :( I want to give an option to "show all states" in the search options. I created a drop-down box with each state and then created one option to "show all states" with % as the value. However, it does not seem to be working. Apparently I missed a step in there somewhere. What do I need to get this to show all states? :)
Giomanach

 

Posts: 6129
Joined: 11/19/2003
From: England
Status: offline

 
RE: Using % to show all results - 3/9/2005 9:39:51   
Can you show us the ASP used to pull the records?

_____________________________




(in reply to A1234)
A1234

 

Posts: 101
Joined: 10/7/2004
Status: offline

 
RE: Using % to show all results - 3/9/2005 9:43:14   
Thanks for your help. Here is what I'm using.

<%
fp_sQry="SELECT * FROM Results WHERE (OriginState = '::OriginState::' OR DestinationState = '::DestinationState::')"
fp_sDefault="OriginState=Null&DestinationState=Null"
fp_sNoRecords="No records returned."
fp_sDataConn="postload"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=25
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="OriginState"
fp_sMenuValue="OriginState"
fp_sColTypes="&UserName=202&ID=3&LoadID=202&OriginState=202&OriginCity=202&DestinationState=202&DestinationCity=202&Miles=202&Rate=202&LoadDate=202&Equipment=202&ContactName=202&ContactPhone=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&"
fp_iDisplayCols=10
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>

Is this what you were referring to? :)

(in reply to Giomanach)
Giomanach

 

Posts: 6129
Joined: 11/19/2003
From: England
Status: offline

 
RE: Using % to show all results - 3/9/2005 9:45:45   
I was looking for that, and the form coding:)

_____________________________




(in reply to A1234)
A1234

 

Posts: 101
Joined: 10/7/2004
Status: offline

 
RE: Using % to show all results - 3/9/2005 9:56:05   
I haven't listed all the states in the drop-downs yet, just s few to do a test run...but here is the form code (there are two drop down search boxes)

<form BOTID="0" METHOD="POST" action="loads.asp">
<input type="hidden" name="fpdbr_0_PagingMove" value=" |< ">
<table BORDER="0">
<tr>
<td><b>Origin State</b></td>
<td><select size="1" name="OriginState">
<option value="Select State" selected>Select State
</option>
<option value="%">All States</option>
<option value="Alaska">Alaska</option>
<option value="Alabama">Alabama</option>
<option value="<%=Server.HtmlEncode(Request("OriginState"))%>"><%=Server.HtmlEncode(Request("OriginState"))%>
</option>
</select></td>
</tr>
<tr>
<td><b>Destination State</b></td>
<td><select size="1" name="DestinationState">
<option selected>Select State</option>
<option value="All States">All States</option>
<option value="Alaska">Alaska</option>
<option>Alabama</option>
<option value="<%=Server.HtmlEncode(Request("DestinationState"))%>"><%=Server.HtmlEncode(Request("DestinationState"))%>
</option>
</select></td>
</tr>
</table>
<br>
<input TYPE="Submit"><input TYPE="Reset"><!--webbot bot="SaveAsASP" clientside suggestedext="asp" preview=" " startspan --><!--webbot bot="SaveAsASP" endspan --></form>

(in reply to Giomanach)
Giomanach

 

Posts: 6129
Joined: 11/19/2003
From: England
Status: offline

 
RE: Using % to show all results - 3/9/2005 10:11:56   
The form:

<form BOTID="0" METHOD="POST" action="loads.asp">
<input type="hidden" name="fpdbr_0_PagingMove" value=" |< ">
<table BORDER="0">
<tr>
<td><b>Origin State</b></td>
<td><select size="1" name="OriginState">
<option value="Select State" selected>Select State</option>
<option value="">All States</option>
<option value="Alaska">Alaska</option>
<option value="Alabama">Alabama</option>
<option value="<%=Server.HtmlEncode(Request("OriginState"))%>"><%=Server.HtmlEncode(Request("OriginState"))%>
</option>
</select></td>
</tr>
<tr>
<td><b>Destination State</b></td>
<td><select size="1" name="DestinationState">
<option selected>Select State</option>
<option value="">All States</option>
<option value="Alaska">Alaska</option>
<option>Alabama</option>
<option value="<%=Server.HtmlEncode(Request("DestinationState"))%>"><%=Server.HtmlEncode(Request("DestinationState"))%>
</option>
</select></td>
</tr>
</table>
<br>
<input type="Submit"><input TYPE="Reset"><!--webbot bot="SaveAsASP" clientside suggestedext="asp" preview=" " startspan --><!--webbot bot="SaveAsASP" endspan --></form>


Form Process:
<%
'Pull Values From Frm
strDestination=Request.Form("DestinationState")
strOrigin=Request.Form("OriginState")

'Set Statement to allow for wildcards
if strDestination="" then
strDestination= "%"
End if

if strOrigin="" then
strOrigin = "%"
End if



'Use FP Recordset to set SQL Query, using LIKE for wildcards.
fp_sQry="SELECT * FROM Results WHERE (OriginState LIKE '" & strOrigin & "') OR (DestinationState LIKE '" & strDestination & "')"

fp_sDefault="OriginState=Null&DestinationState=Null"
fp_sNoRecords="No records returned."
fp_sDataConn="postload"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=25
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="OriginState"
fp_sMenuValue="OriginState"
fp_sColTypes="&UserName=202&ID=3&LoadID=202&OriginState=202&OriginCity=202&DestinationState=202&DestinationCity=202&Miles=202&Rate=202&LoadDate=202&Equipment=202&ContactName=202&ContactPhone=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&"
fp_iDisplayCols=10
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>


The bits I've altered are in bold

HTH

_____________________________




(in reply to A1234)
A1234

 

Posts: 101
Joined: 10/7/2004
Status: offline

 
RE: Using % to show all results - 3/9/2005 10:22:06   
Thanks! I got everything done, except the following (i'm not sure where to place this)

Form Process:
<%
'Pull Values From Frm
strDestination=Request.Form("DestinationState")
strOrigin=Request.Form("OriginState")

'Set Statement to allow for wildcards
if strDestination="" then
strDestination= "%"
End if

if strOrigin="" then
strOrigin = "%"
End if

(in reply to Giomanach)
Giomanach

 

Posts: 6129
Joined: 11/19/2003
From: England
Status: offline

 
RE: Using % to show all results - 3/9/2005 10:50:36   
Leave that where I have put it, it's to get the wildcards in action for you:)

_____________________________




(in reply to A1234)
A1234

 

Posts: 101
Joined: 10/7/2004
Status: offline

 
RE: Using % to show all results - 3/9/2005 11:13:24   
I replaced the code with the info that you provided but it still isn't showing all states :(
The page is located at www.nadras.com/loads.asp, if you want to have a look. There is one record in the database right now (alaska).

Thx again

(in reply to Giomanach)
Giomanach

 

Posts: 6129
Joined: 11/19/2003
From: England
Status: offline

 
RE: Using % to show all results - 3/9/2005 11:22:55   
fp_sQry="SELECT * FROM Results WHERE (OriginState LIKE '" & strOrigin & "') AND (DestinationState LIKE '" & strDestination & "')"

Replace that line with what I've given there

_____________________________




(in reply to A1234)
jmlbige

 

Posts: 62
Joined: 7/22/2004
Status: offline

 
RE: Using % to show all results - 3/9/2005 12:44:12   
Try this... In your DRW click on "More Options" and the "Criteria". From there make sure you have Comparison set to "Contains"

(in reply to Giomanach)
A1234

 

Posts: 101
Joined: 10/7/2004
Status: offline

 
RE: Using % to show all results - 3/9/2005 12:54:04   
jmlbige, thanks very much! I knew it had to be something simple. My page is on the "spooky diet", so I edited the

DestinationState = '::DestinationState::

to

DestinationState LIKE '::DestinationState::

That did the trick!

Thank you to both of you :)

(in reply to jmlbige)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Using % to show all results
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