navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
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

Search Forums
 

Advanced search
Recent Posts

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

Microsoft MVP

 

"OR" statement in Default line

 
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 >> "OR" statement in Default line
Page: [1]
 
Mav44

 

Posts: 122
Joined: 6/25/2006
Status: offline

 
"OR" statement in Default line - 6/2/2007 15:34:02   
Hi Guys & Gals,

Is it possible to use an "or" in a default line such as:

fp_sDefault="o_category=schools or daycare&bf_map=y"

I know I have written this wrong becuase I get nothing back. I think I made need to get rid of the spaces.

Thanks for your time and help in advance!
BeTheBall

 

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

 
RE: "OR" statement in Default line - 6/3/2007 13:29:48   
I would say no it is not possible. What the default does is assign a default value to the form field or querystring value you are searching on. Putting a default value with an or will just create one text string with an OR in it. For example, instead of returning records where the field "animal" is equal to "cat" or "dog", the database would be searched for animals that equal "cat or dog". Does that make sense?

You could use ASP to create alternative SQL strings. For example,

<%
if Trim(Request.Form("animal")) &"" = "" Then
mySQL = "SQL using a default string for the blank field"
else
mySQL = "Standard SQL using the form field value"
end if
%>

Does that make any sense?

Then, in your SQL you would use:

WHERE animal = &" myVar &"

_____________________________

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 Mav44)
Mav44

 

Posts: 122
Joined: 6/25/2006
Status: offline

 
RE: "OR" statement in Default line - 6/3/2007 23:04:45   
Thanks for the answer and suggestion!

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: "OR" statement in Default line - 6/4/2007 10:36:08   
No problem. The last two sentences in my previous post should be ignored. I changed my response and those two lines were left over from the first draft.

_____________________________

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 Mav44)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> "OR" statement in Default line
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