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

 

Multiple Criteria

 
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 >> Multiple Criteria
Page: [1]
 
EHume

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
Multiple Criteria - 3/30/2005 17:45:38   
Hello,

I am new to web design. I have a very simple access database. I have a table with interpreters and the settings they will interpret in and the languages they can interpret. The language query is very simple...I figured out how to do this in Front Page for the Web and it works. The problem I am having is when I add the settings to the query. I have four settings. I have set them in access as four fields with a yes /no. I can get front page to write a query to find the language and One of the settings (Provided I don't put any other settings on the search criteria) or I can get all of the settings with a particular language.

I am inserting my code...hopefully this will help you see where I am trying to go.

<% end if %>
<%
fp_sQry="SELECT * FROM InterpreterQuery WHERE (Lang =  '::InterpLang::' AND Police =  ::QP:: AND Social =  ::QS:: OR Lang =  '::InterpLang::' AND Police =  ::QP:: OR Lang =  '::InterpLang::' AND Social =  ::QS::)"
fp_sDefault="InterpLang=&QP=0&QS=0&InterpLang=&QP=0&InterpLang=&QS=0"
fp_sNoRecords="<tr><td colspan=22 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Interpreter"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="FirstName"
fp_sMenuValue="FirstName"
fp_sColTypes="&FirstName=202&LastName=202&Address=202&City=202&State=202&ZipCode=202&HomePhone=202&CellPhone=202&ContactDay=11&ContactNight=11&ContactAnytime=11&Consecutive=11&Simultaneous=11&Sight=11&Written=11&Medical=11&Legal=11&Social=11&Police=11&Lang=202&OtherEducation=202&ID=3&"
fp_iDisplayCols=22
fp_fCustomQuery=False



Thank you. Any help you can give me to head in the right direction is greatly apprectiated.

Elizabeth

< Message edited by BeTheBall -- 3/30/2005 21:10:46 >
BeTheBall

 

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

 
RE: Multiple Criteria - 3/30/2005 18:46:54   
Welcome to OutFront!

Can you post the code for the search form? I suspect your problem lies in the values you have assigned to the form fields that correspond to the yes/no fields in the db.

_____________________________

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

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 3/30/2005 18:49:53   
Here it is... Thank you! Elizabeth

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<p align="center"><b><font face="Bradley Hand ITC" color="#008080" size="6">
Below are several  search options. </font></b></p>
<p align="center"><b><font face="Bradley Hand ITC" color="#008080" size="6"> Please
choose how you would like to search.</font></b></p>
<p><font face="Bradley Hand ITC" color="#008080" size="5">Find an Interpreter
based on the <b>Language they speak</b>.</font></p>
<form method="POST" action="InterpreterQuery.asp">
<p><select size="1" name="InterpLang">
<option>Farsi</option>
<option>Pashto</option>
<option>Somali</option>
<option>Persian</option>
</select><input type="submit" value="Submit" name="Lang"><input type="reset" value="Reset" name="B2"></p>
<p><input type="checkbox" name="QP" value="-1">Police    
<input type="checkbox" name="QS" value="-1"> Social<select size="1" name="D1">
<option value="-1">Police</option>
</select>  </p>
</form>
<p><font color="#008080" size="5"><font face="Bradley Hand ITC">Find an
interpreter based on the <b>setting </b>they can interpret in. </font></font>
</p>
<p><b><font face="Bradley Hand ITC" color="#008080" size="5"> Please mark
all that apply</font></b></p>
<form method="POST" action="InterpreterQuery.asp">
<p align="center"><input type="reset" value="Reset" name="B2"><input type="submit" value="Submit" name="B1"><font color="#008080" size="5" face="Bradley Hand ITC"><b><input type="radio" value="-1" name="QM">Medic</b></font><b><font color="#008080" size="5"><font face="Bradley Hand ITC">al 
</font></font></b>   <b><font color="#008080" size="5">
<font face="Bradley Hand ITC"><input type="radio" name="QP" value="-1">Police</font></font></b> 
<b><font color="#008080" size="5"><font face="Bradley Hand ITC">
<input type="radio" name="QL" value="-1">Legal 
<input type="radio" name="QS" value="-1">Social</font></font></b></p>
</form>
<p> </p>
<p> </p>

</body>

</html>

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Multiple Criteria - 3/30/2005 21:11:21   
Sorry to say that the code for your form has me a bit baffled. If I am not mistaken, the first form is to allow the user to select a language and then narrow by setting?

Then, you have 4 radio buttons, but they are not named the same meaning the user could technically select all of them. That is what check boxes are for. Radio buttons are to be grouped and the user allowed only one choice among them. So I guess I am unsure as to what you want to have happen there?

Can you clarify a bit?

Once you do so, I think you will need a fairly elaborate scheme to build a workable SQL string, but it can be done.


_____________________________

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

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 3/31/2005 10:50:55   
Hi,

Thank you for your help!

I am trying to get the person to pick the language and then narrow the search down with the settings. The trouble is we may have someone who wants to search only by language or only by setting. Some might want to search by language and one or two settings.

I knew there must be a difference between radio and check. I know the difference in Access and should have just gone with that standard.

I have tried using a complex sql statement in the "custom query" section of front page, but it would not work. I was either doing something wrong or that was the wrong place.

I really do appreciate any help you can give.

Elizabeth

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Multiple Criteria - 3/31/2005 12:32:47   
OK, this may get a little tricky, but let's give it a go. First, replace your two forms, with this:

<form action="InterpreterQuery.asp" method="post">
  <p><label for="language">Language</label> <select size="1" name="language">
  <option selected>Select an Option</option>
  <option value="%">All</option>
  <option value="Farsi">Farsi</option>
  <option value="Pashto">Pashto</option>
  <option value="Somali">Somali</option>
  <option value="Persian">Persian</option>
  </select> </p>
  <p> </p>
  <p>
  <label for="medical">Medical</label>
  <input type="checkbox" value="1" name="medical">
  <label for="police">Police</label>
  <input type="checkbox" value="1" name="police">
  <label for="legal">Legal</label>
  <input type="checkbox" value="1" name="legal">
  <label for="social">Social</label>
  <input type="checkbox" value="1" name="social"></p>
  <p>
  <input type="submit" value="Submit" name="B1">
  <input type="reset" value="Reset" name="B2">
  </p>
</form>


Then on the page that shows the results. Replace this line:

fp_sQry="SELECT * FROM InterpreterQuery WHERE (Lang = '::InterpLang::' AND Police = ::QP:: AND Social = ::QS:: OR Lang = '::InterpLang::' AND Police = ::QP:: OR Lang = '::InterpLang::' AND Social = ::QS::)"

With:

mySQL = "SELECT * FROM InterpreterQuery WHERE Lang LIKE '%::language::%'"
If Request.Form("medical") = 1 Then
mySQL = mySQL & "AND Medical = 1"
End If
If Request.Form("police") = 1 Then
mySQL = mySQL & "AND Police = 1"
End If
If Request.Form("legal") = 1 Then
mySQL = mySQL & "AND Legal = 1"
End IF
If Request.Form("social") = 1 Then
mySQL = mySQL & "AND Social = 1" 
End If
fp_sQry=mySQL


You should make backups of your pages before applying the above changes. See where that gets you and get back with us if you need further help.


_____________________________

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

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 3/31/2005 14:22:10   
Duane,

I have the first page completed no problem. The second page gives me this error when I try to save it with the "new" code.

The contents of a FrontPage component have been modified. These contents will be overwritten when you save this page.


I have tried to save as and it still reverts back to the "old" code.

Help!

Elizabeth

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Multiple Criteria - 3/31/2005 15:13:55   
OK, to be able to modify the red code, we need to get rid of most of the gray code. Around here, we call that "dieting" the code. Here is a tutorial on how to do that:

http://www.outfront.net/spooky/adv_drw_diet.htm

Once you diet it, you should be able to do the modification.

_____________________________

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 EHume)
dzirkelb1

 

Posts: 1315
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Multiple Criteria - 3/31/2005 15:14:30   
You will have to put your code on a diet...refer to http://www.outfront.net/spooky/adv_drw_diet.htm for instructions on how to do so...then it will work :)

edit--I type too slow again! :)

(in reply to EHume)
EHume

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 3/31/2005 17:34:19   
Hello,

I think I got the code cleaned up...I can save the new code in, but it doesn't work when I publish it to the web? Any help would be greatly apprecitated. I am puzzled...

Here is the Code from the First Page with the Form:(Marked in Purple)


<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>





<form action="InterpreterQuery.asp" method="post">
<p><label for="language">Language</label> <select size="1" name="language">
<option selected>Select an Option</option>
<option value="%">All</option>
<option value="Farsi">Farsi</option>
<option value="Pashto">Pashto</option>
<option value="Somali">Somali</option>
<option value="Persian">Persian</option>
</select> </p>
<p> </p>
<p>
<label for="medical">Medical</label>
<input type="checkbox" value="1" name="medical">
<label for="police">Police</label>
<input type="checkbox" value="1" name="police">
<label for="legal">Legal</label>
<input type="checkbox" value="1" name="legal">
<label for="social">Social</label>
<input type="checkbox" value="1" name="social"></p>
<p>
<input type="submit" value="Submit" name="B1">
<input type="reset" value="Reset" name="B2">
</p>
</form>

</form>
<p> </p>

</body>

</html>



Here is the code from the second Page. marked in blue

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<p> </p>
<table width="100%" border="1">
<thead>
<tr>
<td><b>FirstName</b></td>
<td><b>LastName</b></td>
<td><b>Address</b></td>
<td><b>City</b></td>
<td><b>State</b></td>
<td><b>ZipCode</b></td>
<td><b>HomePhone</b></td>
<td><b>CellPhone</b></td>
<td><b>ContactDay</b></td>
<td><b>ContactNight</b></td>
<td><b>ContactAnytime</b></td>
<td><b>Consecutive</b></td>
<td><b>Simultaneous</b></td>
<td><b>Sight</b></td>
<td><b>Written</b></td>
<td><b>Medical</b></td>
<td><b>Legal</b></td>
<td><b>Social</b></td>
<td><b>Police</b></td>
<td><b>Lang</b></td>
<td><b>OtherEducation</b></td>
<td><b>ID</b></td>
</tr>
</thead>
<tbody>
b-WasTableFormat="TRUE" startspan --><!--#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 %>
<%
mySQL = "SELECT * FROM InterpreterQuery WHERE Lang LIKE '%::language::%'"
If Request.Form("medical") = 1 Then
mySQL = mySQL & "AND Medical = 1"
End If
If Request.Form("police") = 1 Then
mySQL = mySQL & "AND Police = 1"
End If
If Request.Form("legal") = 1 Then
mySQL = mySQL & "AND Legal = 1"
End IF
If Request.Form("social") = 1 Then
mySQL = mySQL & "AND Social = 1"
End If
fp_sQry=mySQL
fp_sQry=MySQL
fp_sDefault="InterpLang="
fp_sNoRecords="<tr><td colspan=22 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Interpreter"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="FirstName"
fp_sMenuValue="FirstName"
fp_sColTypes="&FirstName=202&LastName=202&Address=202&City=202&State=202&ZipCode=202&HomePhone=202&CellPhone=202&ContactDay=11&ContactNight=11&ContactAnytime=11&Consecutive=11&Simultaneous=11&Sight=11&Written=11&Medical=11&Legal=11&Social=11&Police=11&Lang=202&OtherEducation=202&ID=3&"
fp_iDisplayCols=22
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<tr>
<td>

<%=FP_FieldVal(fp_rs,"FirstName")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"LastName")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Address")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"City")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"State")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"ZipCode")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"HomePhone")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"CellPhone")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"ContactDay")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"ContactNight")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"ContactAnytime")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Consecutive")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Simultaneous")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Sight")%>  <td>
<%=FP_FieldVal(fp_rs,"Written")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Medical")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Legal")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Social")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Police")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Lang")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"OtherEducation")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"ID")%>  </td>
</tr>
</tbody>
</table>
<p> </p>

</body>

</html>

(in reply to dzirkelb1)
BeTheBall

 

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

 
RE: Multiple Criteria - 3/31/2005 18:10:49   
What happens on the web? Do you get an error message? I would have been shocked if this worked right out of the box. I am sure we will need to do some fine tuning.

_____________________________

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

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 3/31/2005 18:14:08   
When I click submit it goes to Page will not display.

Thank you.

Elizabeth

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Multiple Criteria - 3/31/2005 18:26:57   
You need to change your setting in IE to get the true error message. Go to Tools - Internet Options - Advanced and then find the box labeled, "Show friendly http error messages" and uncheck it. Then try and view the page again and you should get a more descriptive error message.

_____________________________

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 EHume)
BeTheBall

 

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

 
RE: Multiple Criteria - 3/31/2005 18:31:33   
You missed a few characters, deleted a needed include file, and added fp_sQry=mySQL
twice. Try this version of page 2:

<html> 

<head> 
<meta http-equiv="Content-Language" content="en-us"> 
<meta name="GENERATOR" content="Microsoft FrontPage 5.0"> 
<meta name="ProgId" content="FrontPage.Editor.Document"> 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 
<title>New Page 1</title> 
</head> 

<body> 

<p> </p> 
<table width="100%" border="1"> 
<thead> 
<tr> 
<td><b>FirstName</b></td> 
<td><b>LastName</b></td> 
<td><b>Address</b></td> 
<td><b>City</b></td> 
<td><b>State</b></td> 
<td><b>ZipCode</b></td> 
<td><b>HomePhone</b></td> 
<td><b>CellPhone</b></td> 
<td><b>ContactDay</b></td> 
<td><b>ContactNight</b></td> 
<td><b>ContactAnytime</b></td> 
<td><b>Consecutive</b></td> 
<td><b>Simultaneous</b></td> 
<td><b>Sight</b></td> 
<td><b>Written</b></td> 
<td><b>Medical</b></td> 
<td><b>Legal</b></td> 
<td><b>Social</b></td> 
<td><b>Police</b></td> 
<td><b>Lang</b></td> 
<td><b>OtherEducation</b></td> 
<td><b>ID</b></td> 
</tr> 
</thead> 
<tbody> 
<!--#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 %> 
<% 
mySQL = "SELECT * FROM InterpreterQuery WHERE Lang LIKE '%::language::%'" 
If Request.Form("medical") = 1 Then 
mySQL = mySQL & "AND Medical = 1" 
End If 
If Request.Form("police") = 1 Then 
mySQL = mySQL & "AND Police = 1" 
End If 
If Request.Form("legal") = 1 Then 
mySQL = mySQL & "AND Legal = 1" 
End IF 
If Request.Form("social") = 1 Then 
mySQL = mySQL & "AND Social = 1" 
End If 
fp_sQry=mySQL 
fp_sDefault="InterpLang=" 
fp_sNoRecords="<tr><td colspan=22 align=left width=""100%"">No records returned.</td></tr>" 
fp_sDataConn="Interpreter" 
fp_iMaxRecords=256 
fp_iCommandType=1 
fp_iPageSize=5 
fp_fTableFormat=True 
fp_fMenuFormat=False 
fp_sMenuChoice="FirstName" 
fp_sMenuValue="FirstName" 
fp_sColTypes="&FirstName=202&LastName=202&Address=202&City=202&State=202&ZipCode=202&HomePhone=202&CellPhone=202&ContactDay=11&ContactNight=11&ContactAnytime=11&Consecutive=11&Simultaneous=11&Sight=11&Written=11&Medical=11&Legal=11&Social=11&Police=11&Lang=202&OtherEducation=202&ID=3&" 
fp_iDisplayCols=22 
fp_fCustomQuery=False 
BOTID=1 
fp_iRegion=BOTID 
%> 
<!--#include file="_fpclass/fpdbrgn1.inc"--> 
<tr> 
<td> 

<%=FP_FieldVal(fp_rs,"FirstName")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"LastName")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"Address")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"City")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"State")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"ZipCode")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"HomePhone")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"CellPhone")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"ContactDay")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"ContactNight")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"ContactAnytime")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"Consecutive")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"Simultaneous")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"Sight")%>  <td> 
<%=FP_FieldVal(fp_rs,"Written")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"Medical")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"Legal")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"Social")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"Police")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"Lang")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"OtherEducation")%>  </td> 
<td> 
<%=FP_FieldVal(fp_rs,"ID")%>  </td> 
</tr> 
<!--#include file="_fpclass/fpdbrgn2.inc"-->
</tbody> 
</table> 
<p> </p> 

</body> 

</html>


_____________________________

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 BeTheBall)
EHume

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 3/31/2005 18:32:17   
Okay...thanks for being so patient with me.

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/InterpreterQuery.asp, line 51, column 18
mySQL = mySQL & "AND Medical = 1"
-----------------^


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

Page:
POST 34 bytes to /InterpreterQuery.asp

POST Data:
language=Farsi&medical=1&B1=Submit

Time:
Thursday, March 31, 2005, 4:29:24 PM


More information:
Microsoft Support

(in reply to BeTheBall)
EHume

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 3/31/2005 18:43:25   
Okay...Now I get a page...but there are no results.

Elizabeth

(in reply to EHume)
BeTheBall

 

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

 
RE: Multiple Criteria - 3/31/2005 18:43:56   
First, replace your code with what I posted in my post just before your last one (you probably missed it.) Then, replace this:

mySQL = mySQL & "AND Medical = 1"
End If
If Request.Form("police") = 1 Then
mySQL = mySQL & "AND Police = 1"
End If
If Request.Form("legal") = 1 Then
mySQL = mySQL & "AND Legal = 1"
End IF
If Request.Form("social") = 1 Then
mySQL = mySQL & "AND Social = 1"

with:

mySQL = mySQL & " AND Medical = 1"
End If
If Request.Form("police") = 1 Then
mySQL = mySQL & " AND Police = 1"
End If
If Request.Form("legal") = 1 Then
mySQL = mySQL & " AND Legal = 1"
End IF
If Request.Form("social") = 1 Then
mySQL = mySQL & " AND Social = 1"

_____________________________

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

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 3/31/2005 18:48:27   
I have done all of the corrections, but still get "no database results"

Thank you again for your continued patience.

Elizabeth

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Multiple Criteria - 3/31/2005 18:49:36   
One more important thing, change to:

mySQL = mySQL & " AND Medical = -1"
End If
If Request.Form("police") = 1 Then
mySQL = mySQL & " AND Police = -1"
End If
If Request.Form("legal") = 1 Then
mySQL = mySQL & " AND Legal = -1"
End IF
If Request.Form("social") = 1 Then
mySQL = mySQL & " AND Social = -1"

_____________________________

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 BeTheBall)
EHume

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 3/31/2005 18:56:19   
No luck yet. Still "No database results"

Sorry.

Elizabeth

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Multiple Criteria - 3/31/2005 18:57:26   
OK. If you search by simply language and check none of the checkboxes, do you get any results?

_____________________________

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

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 3/31/2005 18:59:26   
No. Same result.


(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Multiple Criteria - 3/31/2005 19:03:19   
Please post the current code for Page 2

_____________________________

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

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 4/1/2005 10:45:30   
Here is the code. Thank you.


<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<p> </p>
<table width="100%" border="1">
<thead>
<tr>
<td><b>FirstName</b></td>
<td><b>LastName</b></td>
<td><b>Address</b></td>
<td><b>City</b></td>
<td><b>State</b></td>
<td><b>ZipCode</b></td>
<td><b>HomePhone</b></td>
<td><b>CellPhone</b></td>
<td><b>ContactDay</b></td>
<td><b>ContactNight</b></td>
<td><b>ContactAnytime</b></td>
<td><b>Consecutive</b></td>
<td><b>Simultaneous</b></td>
<td><b>Sight</b></td>
<td><b>Written</b></td>
<td><b>Medical</b></td>
<td><b>Legal</b></td>
<td><b>Social</b></td>
<td><b>Police</b></td>
<td><b>Lang</b></td>
<td><b>OtherEducation</b></td>
<td><b>ID</b></td>
</tr>
</thead>
<tbody>
<!--#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 %>
<%
mySQL = "SELECT * FROM InterpreterQuery WHERE Lang LIKE '%::language::%'"
If Request.Form("medical") = 1 Then
mySQL = mySQL & " AND Medical = -1"
End If
If Request.Form("police") = 1 Then
mySQL = mySQL & " AND Police = -1"
End If
If Request.Form("legal") = 1 Then
mySQL = mySQL & " AND Legal = -1"
End IF
If Request.Form("social") = 1 Then
mySQL = mySQL & " AND Social = -1"
End If
fp_sQry=mySQL
fp_sDefault="language="
fp_sNoRecords="<tr><td colspan=22 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Interpreter"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="FirstName"
fp_sMenuValue="FirstName"
fp_sColTypes="&;FirstName=202&;LastName=202&;Address=202&;City=202&;State=202&;ZipCode=202&;HomePhone=202&;CellPhone=202&;ContactDay=11&;ContactNight=11&;ContactAnytime=11&;Consecutive=11&;Simultaneous=11&;Sight=11&;Written=11&;Medical=11&;Legal=11&;Social=11&;Police=11&;Lang=202&;OtherEducation=202&;ID=3&;"
fp_iDisplayCols=22
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<tr>
<td>

<%=FP_FieldVal(fp_rs,"FirstName")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"LastName")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Address")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"City")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"State")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"ZipCode")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"HomePhone")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"CellPhone")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"ContactDay")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"ContactNight")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"ContactAnytime")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Consecutive")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Simultaneous")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Sight")%>  <td>
<%=FP_FieldVal(fp_rs,"Written")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Medical")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Legal")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Social")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Police")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"Lang")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"OtherEducation")%>  </td>
<td>
<%=FP_FieldVal(fp_rs,"ID")%>  </td>
</tr>
<!--#include file="_fpclass/fpdbrgn2.inc"-->
</tbody>
</table>
<p> </p>

</body>

</html>

(in reply to BeTheBall)
rdouglass

 

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

 
RE: Multiple Criteria - 4/1/2005 11:11:11   
quote:

mySQL = mySQL & " AND Medical = -1"


If I may make a suggestion, I always have issues with AND's and OR's until I group 'em with parens:

...
mySQL = mySQL & " AND (Medical = -1)"
...

Just my $.02

_____________________________

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

ASP Checkbox Function Tutorial.

(in reply to EHume)
EHume

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 4/1/2005 11:19:58   
Rdouglass,

I tried that...did not work. Same result.

Thank you...I will take all the $.02 I can get!

E

(in reply to rdouglass)
BeTheBall

 

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

 
RE: Multiple Criteria - 4/1/2005 11:31:58   
change these two lines:

End If
fp_sQry=mySQL

to

End If
Response.write mySQL
Response.end
fp_sQry=mySQL

That will tell us what SQL is being written.

_____________________________

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

 

Posts: 22
Joined: 3/29/2005
Status: offline

 
RE: Multiple Criteria - 4/1/2005 11:44:15   
Okay...this is what shows on the page.



SELECT * FROM InterpreterQuery WHERE Lang LIKE '%::language::%' AND (Medical = -1)

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Multiple Criteria - 4/1/2005 11:54:32   
Just sent you a private message. My concern is perhaps your database table is not structured as I am imagining.

_____________________________

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 EHume)
dzirkelb1

 

Posts: 1315
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Multiple Criteria - 4/1/2005 13:43:20   
mySQL = "SELECT * FROM InterpreterQuery WHERE (Lang LIKE '%::language::%')"

always worth a shot...I, too, have problems with and operators and no parenthees

(in reply to BeTheBall)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Multiple Criteria
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