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

Search Forums
 

Advanced search
Recent Posts

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

 

.asp search page question

 
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 >> .asp search page question
Page: [1]
 
John316

 

Posts: 214
Joined: 9/25/2002
Status: offline

 
.asp search page question - 10/12/2002 11:19:40   
Question: I created a search .asp page that uses the tfilter function. I want to search my Microsoft Access Database, but my tfilterfunction will not work if my ITEMLOC is null. Is there a way for this function to work weather it ITEMLOC is null or not? My code is below:

<%
tfilter = " WHERE (USERNAME = ' " & Request.Form(" ITEM_USERNAME" ) & " ' ) AND (ITEMLOC = ' " & Request.Form(" ITEM_LOC" ) & " ' ) "
' Response.Write tfilter & " <br>"
%>

Thanks,
John316
Doug G

 

Posts: 1189
Joined: 12/29/2001
From: SoCal
Status: offline

 
RE: .asp search page question - 10/12/2002 12:00:34   
Try something like this (I haven' t tested this code)
<% 
dim strLoc
tfilter = "  WHERE (USERNAME = ' "  & Request.Form(" ITEM_USERNAME" ) & " ' )
strLoc = Request.Form(" ITEM_LOC" )
If IsNull(StrLoc) Then StrLoc = " " 
If Len(StrLoc) > 0 Then
   AND (ITEMLOC = ' "  & strLoc & " ' ) "  
End If
' Response.Write tfilter & " <br>"  
%> 


< Message edited by Doug G -- 10/11/2002 12:01:11 PM >


_____________________________

======
Doug G
======

(in reply to John316)
John316

 

Posts: 214
Joined: 9/25/2002
Status: offline

 
RE: .asp search page question - 10/21/2002 11:30:50   
Doug that code did not work. can you think of anything else?

John316

(in reply to Doug G)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: .asp search page question - 10/22/2002 3:48:35   
Dougs code looks alright, possibly trim it in case there is a space?

strLoc = trim(Request.Form(" ITEM_LOC" ))

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to John316)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> .asp search page question
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