jensjakobsen
asked on
Search and resultspage with multiple seach fields (checkboxes and textfields)
I have a search page (soeg.asp) where I want the users to search from multiple search fields.
The search fields are:
- Name (text field)
- Zip code 1 (text field)
- Zip code 2 (text field), (so that you can narrow results between zip codes)
- 6 different checkboxes
Right now my name search is being ignored - zipcodes and checkboxes are OK.
Below you will find the form search page
<form action="resultat_soeg.asp" method="post" name="form1" target="_self">
<input name="strNavnE" type="text" id="strNavnE">
<input name="strPostnummerET" type="text" id="strPostnummerET" size="10">
<input name="strPostnummerTO" type="text" id="strPostnummerTO" size="10">
<input name="intKvitto" type="checkbox" id="intKvitto" value="1">
<input name="intAfslag" type="checkbox" id="intAfslag" value="1">
<input name="intAfslaaet" type="checkbox" id="intAfslaaet" value="1">
<input name="intTalentBank" type="checkbox" id="intTalentBank" value="1">
<input name="intTlfInterview" type="checkbox" id="intTlfInterview" value="1">
<input name="intPersInterview" type="checkbox" id="intPersInterview" value="1">
<input type="submit" name="Submit" value="Søg">
<input type="reset" name="Submit2" value="Annullér">
</form> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
Below you will find the dreamweaver genereated code from the resultspage:
<%
Dim RSCV__soegNavn
RSCV__soegNavn = "noName"
If (Request.Form("strNavnE") Â Â <> "") Then
 RSCV__soegNavn = Request.Form("strNavn") Â
End If
%>
<%
Dim RSCV__soegPostnummerET
RSCV__soegPostnummerET = "999999"
If (Request.Form("strPostnumm erET") Â Â Â Â Â Â Â Â Â <>Â "") Then
 RSCV__soegPostnummerET = Request.Form("strPostnumme rET")         Â
End If
%>
<%
Dim RSCV__soegPostnummerTO
RSCV__soegPostnummerTO = "9999"
If (Request.Form("strPostnumm erTO") Â Â Â Â Â Â Â Â Â <>Â "") Then
 RSCV__soegPostnummerTO = Request.Form("strPostnumme rTO")         Â
End If
%>
<%
Dim RSCV__soegKvitto
RSCV__soegKvitto = "0"
If (Request.Form("intKvitto") <>Â "") Then
 RSCV__soegKvitto = Request.Form("intKvitto")
End If
%>
<%
Dim RSCV__soegAfslag
RSCV__soegAfslag = "0"
If (Request.Form("intAfslag") <>Â "") Then
 RSCV__soegAfslag = Request.Form("intAfslag")
End If
%>
<%
Dim RSCV__soegAfslaaet
RSCV__soegAfslaaet = "0"
If (Request.Form("intAfslaaet ") <>Â "") Then
 RSCV__soegAfslaaet = Request.Form("intAfslaaet" )
End If
%>
<%
Dim RSCV__soegTalentbank
RSCV__soegTalentbank = "0"
If (Request.Form("intTalentba nk") <>Â "") Then
 RSCV__soegTalentbank = Request.Form("intTalentban k")
End If
%>
<%
Dim RSCV__soegTlfinterview
RSCV__soegTlfinterview = "0"
If (Request.Form("intTlfinter view") <>Â "") Then
 RSCV__soegTlfinterview = Request.Form("intTlfinterv iew")
End If
%>
<%
Dim RSCV__soegPersinterview
RSCV__soegPersinterview = "0"
If (Request.Form("intPersInte rview") <>Â "") Then
 RSCV__soegPersinterview = Request.Form("intPersInter view")
End If
%>
'The SQL from the SQL dialog box:
SELECT * FROM tblAnsog
WHERE (strNavn LIKE '%soegNavn%') AND
(strPostnummer BETWEEN (soegPostnummerET) AND (soegPostnummerTO)) AND
((intKvitto = 1 and soegKvitto = 1) OR soegKvitto = 0) AND
((intAfslag = 1 AND soegAfslag = 1) OR soegAfslag = 0) AND
((intAfslaaet = 1 and soegAfslaaet = 1) OR soegAfslaaet = 0) AND
((intTalentbank = 1 Â and soegTalentbank = 1) OR soegTalentbank = 0) AND
((intTlfinterview = 1 Â and soegTlfinterview = 1) OR soegTlfinterview = 0) AND
((intPersinterview = 1 Â and soegPersinterview = 1) OR soegPersinterview = 0)
The search fields are:
- Name (text field)
- Zip code 1 (text field)
- Zip code 2 (text field), (so that you can narrow results between zip codes)
- 6 different checkboxes
Right now my name search is being ignored - zipcodes and checkboxes are OK.
Below you will find the form search page
<form action="resultat_soeg.asp"
<input name="strNavnE" type="text" id="strNavnE">
<input name="strPostnummerET" type="text" id="strPostnummerET" size="10">
<input name="strPostnummerTO" type="text" id="strPostnummerTO" size="10">
<input name="intKvitto" type="checkbox" id="intKvitto" value="1">
<input name="intAfslag" type="checkbox" id="intAfslag" value="1">
<input name="intAfslaaet" type="checkbox" id="intAfslaaet" value="1">
<input name="intTalentBank" type="checkbox" id="intTalentBank" value="1">
<input name="intTlfInterview" type="checkbox" id="intTlfInterview" value="1">
<input name="intPersInterview" type="checkbox" id="intPersInterview" value="1">
<input type="submit" name="Submit" value="Søg">
<input type="reset" name="Submit2" value="Annullér">
</form> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
Below you will find the dreamweaver genereated code from the resultspage:
<%
Dim RSCV__soegNavn
RSCV__soegNavn = "noName"
If (Request.Form("strNavnE") Â Â <> "") Then
 RSCV__soegNavn = Request.Form("strNavn") Â
End If
%>
<%
Dim RSCV__soegPostnummerET
RSCV__soegPostnummerET = "999999"
If (Request.Form("strPostnumm
 RSCV__soegPostnummerET = Request.Form("strPostnumme
End If
%>
<%
Dim RSCV__soegPostnummerTO
RSCV__soegPostnummerTO = "9999"
If (Request.Form("strPostnumm
 RSCV__soegPostnummerTO = Request.Form("strPostnumme
End If
%>
<%
Dim RSCV__soegKvitto
RSCV__soegKvitto = "0"
If (Request.Form("intKvitto")
 RSCV__soegKvitto = Request.Form("intKvitto")
End If
%>
<%
Dim RSCV__soegAfslag
RSCV__soegAfslag = "0"
If (Request.Form("intAfslag")
 RSCV__soegAfslag = Request.Form("intAfslag")
End If
%>
<%
Dim RSCV__soegAfslaaet
RSCV__soegAfslaaet = "0"
If (Request.Form("intAfslaaet
 RSCV__soegAfslaaet = Request.Form("intAfslaaet"
End If
%>
<%
Dim RSCV__soegTalentbank
RSCV__soegTalentbank = "0"
If (Request.Form("intTalentba
 RSCV__soegTalentbank = Request.Form("intTalentban
End If
%>
<%
Dim RSCV__soegTlfinterview
RSCV__soegTlfinterview = "0"
If (Request.Form("intTlfinter
 RSCV__soegTlfinterview = Request.Form("intTlfinterv
End If
%>
<%
Dim RSCV__soegPersinterview
RSCV__soegPersinterview = "0"
If (Request.Form("intPersInte
 RSCV__soegPersinterview = Request.Form("intPersInter
End If
%>
'The SQL from the SQL dialog box:
SELECT * FROM tblAnsog
WHERE (strNavn LIKE '%soegNavn%') AND
(strPostnummer BETWEEN (soegPostnummerET) AND (soegPostnummerTO)) AND
((intKvitto = 1 and soegKvitto = 1) OR soegKvitto = 0) AND
((intAfslag = 1 AND soegAfslag = 1) OR soegAfslag = 0) AND
((intAfslaaet = 1 and soegAfslaaet = 1) OR soegAfslaaet = 0) AND
((intTalentbank = 1 Â and soegTalentbank = 1) OR soegTalentbank = 0) AND
((intTlfinterview = 1 Â and soegTlfinterview = 1) OR soegTlfinterview = 0) AND
((intPersinterview = 1 Â and soegPersinterview = 1) OR soegPersinterview = 0)
Can you show me how you call the SQL statement from inside ASP? Â I need to see how ASP is passing the parameters to the database
ASKER
Hi - thank you for answering.
I would prefer if I can keep everything within Dreamweavers ability to edit via it's WYSIWYG interface.
Below is the WHOLE code:
<!--%@LANGUAGE="VBSCRIPT"% -->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/connF eedback.as p" -->
<%
Dim RSCV__soegNavn
RSCV__soegNavn = "0"
If (Request.Form("strNavn") Â Â Â <> "") Then
RSCV__soegNavn = Request.Form("strNavn") Â Â
End If
%>
<%
Dim RSCV__soegPostnummerET
RSCV__soegPostnummerET = "999999"
If (Request.Form("strPostnumm erET") Â Â Â Â Â Â Â Â Â <>Â "") Then
RSCV__soegPostnummerET = Request.Form("strPostnumme rET") Â Â Â Â Â Â Â Â Â
End If
%>
<%
Dim RSCV__soegPostnummerTO
RSCV__soegPostnummerTO = "9999999"
If (Request.Form("strPostnumm erTO") Â Â Â Â Â Â Â Â Â Â <> "") Then
RSCV__soegPostnummerTO = Request.Form("strPostnumme rTO") Â Â Â Â Â Â Â Â Â
End If
%>
<%
Dim RSCV__soegKvitto
RSCV__soegKvitto = "0"
If (Request.Form("intKvitto") <>Â "") Then
RSCV__soegKvitto = Request.Form("intKvitto")
End If
%>
<%
Dim RSCV__soegAfslag
RSCV__soegAfslag = "0"
If (Request.Form("intAfslag") <>Â "") Then
RSCV__soegAfslag = Request.Form("intAfslag")
End If
%>
<%
Dim RSCV__soegAfslaaet
RSCV__soegAfslaaet = "0"
If (Request.Form("intAfslaaet ") <>Â "") Then
RSCV__soegAfslaaet = Request.Form("intAfslaaet" )
End If
%>
<%
Dim RSCV__soegTalentbank
RSCV__soegTalentbank = "0"
If (Request.Form("intTalentba nk") <>Â "") Then
RSCV__soegTalentbank = Request.Form("intTalentban k")
End If
%>
<%
Dim RSCV__soegTlfinterview
RSCV__soegTlfinterview = "0"
If (Request.Form("intTlfinter view") <>Â "") Then
RSCV__soegTlfinterview = Request.Form("intTlfinterv iew")
End If
%>
<%
Dim RSCV__soegPersinterview
RSCV__soegPersinterview = "0"
If (Request.Form("intPersInte rview") <>Â "") Then
RSCV__soegPersinterview = Request.Form("intPersInter view")
End If
%>
<%
Dim RSCV
Dim RSCV_numRows
Set RSCV = Server.CreateObject("ADODB .Recordset ")
RSCV.ActiveConnection = MM_connFeedback_STRING
RSCV.Source = "SELECT *  FROM tblAnsog  WHERE (strNavn LIKE '%" + Replace(RSCV__soegNavn, "'", "''") + "%') AND (strPostnummer BETWEEN (" + Replace(RSCV__soegPostnumm erET, "'", "''") + ") AND (" + Replace(RSCV__soegPostnumm erTO, "'", "''") + ")) AND ((intKvitto = 1 and " + Replace(RSCV__soegKvitto, "'", "''") + " = 1) OR " + Replace(RSCV__soegKvitto, "'", "''") + " = 0) AND ((intAfslag = 1 AND " + Replace(RSCV__soegAfslag, "'", "''") + " = 1) OR " + Replace(RSCV__soegAfslag, "'", "''") + " = 0) AND ((intAfslaaet = 1 and " + Replace(RSCV__soegAfslaaet , "'", "''") + " = 1) OR " + Replace(RSCV__soegAfslaaet , "'", "''") + " = 0) AND ((intTalentbank = 1  and " + Replace(RSCV__soegTalentba nk, "'", "''") + " = 1) OR " + Replace(RSCV__soegTalentba nk, "'", "''") + " = 0) AND ((intTlfinterview = 1  and " + Replace(RSCV__soegTlfinter view, "'", "''") + " = 1) OR " + Replace(RSCV__soegTlfinter view, "'", "''") + " = 0) AND ((intPersinterview = 1  and " + Replace(RSCV__soegPersinte rview, "'", "''") + " = 1) OR " + Replace(RSCV__soegPersinte rview, "'", "''") + " = 0)  ORDER BY strPostnummer ASC"
RSCV.CursorType = 0
RSCV.CursorLocation = 2
RSCV.LockType = 1
RSCV.Open()
RSCV_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
RSCV_numRows = RSCV_numRows + Repeat1__numRows
%>
<%
' Â *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim RSCV_total
Dim RSCV_first
Dim RSCV_last
' set the record count
RSCV_total = RSCV.RecordCount
' set the number of rows displayed on this page
If (RSCV_numRows <Â 0) Then
RSCV_numRows = RSCV_total
Elseif (RSCV_numRows = 0) Then
RSCV_numRows = 1
End If
' set the first and last displayed record
RSCV_first = 1
RSCV_last  = RSCV_first + RSCV_numRows - 1
' if we have the correct record count, check the other stats
If (RSCV_total <>Â -1) Then
If (RSCV_first >Â RSCV_total) Then
RSCV_first = RSCV_total
End If
If (RSCV_last >Â RSCV_total) Then
RSCV_last = RSCV_total
End If
If (RSCV_numRows >Â RSCV_total) Then
RSCV_numRows = RSCV_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (RSCV_total = -1) Then
' count the total records by iterating through the recordset
RSCV_total=0
While (Not RSCV.EOF)
RSCV_total = RSCV_total + 1
RSCV.MoveNext
Wend
' reset the cursor to the beginning
If (RSCV.CursorType >Â 0) Then
RSCV.MoveFirst
Else
RSCV.Requery
End If
' set the number of rows displayed on this page
If (RSCV_numRows <Â 0 Or RSCV_numRows >Â RSCV_total) Then
RSCV_numRows = RSCV_total
End If
' set the first and last displayed record
RSCV_first = 1
RSCV_last = RSCV_first + RSCV_numRows - 1
If (RSCV_first >Â RSCV_total) Then
RSCV_first = RSCV_total
End If
If (RSCV_last >Â RSCV_total) Then
RSCV_last = RSCV_total
End If
End If
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <>Â "") Then
MM_removeList = MM_removeList &Â "&" &Â MM_paramName &Â "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&"Â & MM_item &Â "="
If (InStr(1,MM_removeList,MM_ nextItem,1 ) = 0) Then
MM_keepURL = MM_keepURL &Â MM_nextItem &Â Server.URLencode(Request.Q ueryString (MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&"Â & MM_item &Â "="
If (InStr(1,MM_removeList,MM_ nextItem,1 ) = 0) Then
MM_keepForm = MM_keepForm &Â MM_nextItem &Â Server.URLencode(Request.F orm(MM_ite m))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL &Â MM_keepForm
If (MM_keepBoth <>Â "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <>Â "") Â Then
MM_keepURL Â = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <>Â "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <>Â "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Admin modul</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="supercss.css" rel="stylesheet" type="text/css">
<script type="text/JavaScript">
<!--
function altRowColors(){ //v2.0
var args = arguments, obj, color0, color1, rowList;
for(var a = 0; a <Â args.length; a+=3){
obj = args[a+0]; color0 = args[a+1]; color1 = args[a+2];
obj = (isNaN(obj)) ? document.getElementById(ob j) : document.getElementsByTagN ame("TABLE ")[obj];
if(obj) rowList = obj.getElementsByTagName(" TR");
for(var i = 0; i <Â rowList.length; i++) rowList[i].style.backgroun dColor = eval('color'+(i % 2));
}
}
//-->
</script>
</head>
<body style="margin:0px; height:100%;" onLoad="altRowColors('data ','#ffffff ','#f0f0f0 ')">
<table width="100%" height="100%" Â cellpadding="0" cellspacing="0" border="0" style="position:absolute; top:0px; bottom:0px; left:0px; right:0px;">
<tr>
<td width="780" align="left" valign="top">
<table width="100%" Â border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" Â border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" class="bg_image"> </t d>
<td width="185" align="left" valign="top"><img src="images/logo.jpg" width="185" height="48"></td>
</tr>
<tr>
<td align="left" valign="top"><%= Request.Form("strNavn") %></td>
<td align="left" valign="top"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" Â border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10"> Â Â Â Â Â </td>
<td align="left" valign="top"><table width="100%" Â border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="150" align="left" valign="top"><table width="100%" Â border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="admin_fat"><a href="admin.asp">Hjem</a>< /td>
</tr>
<tr>
<td class="newstext"> </t d>
</tr>
<tr>
<td class="newstext"> </t d>
</tr>
</table></td>
<td align="left" valign="top"><table width="100%" border="0">
<tr>
<td class="newsheadline">Avanc eret søgeside på alle ansøgere (<%=(RSCV_total)%>) </td>
</tr>
<tr>
<td><form action="resultat_soeg.asp" method="post" name="form1" target="_self">
<table width="100%" border="0">
<tr>
<td align="left" valign="top" class="body_fields">Navn</ td>
<td align="left" valign="top" class="body_fields"><input name="strNavn" type="text" id="strNavn" value="<%= Request.Form("strNavn") %>"></td>
</tr>
<tr>
<td align="left" valign="top" class="body_fields">Postnu mmer 1 </td>
<td align="left" valign="top" class="body_fields"><input name="strPostnummerET" type="text" id="strPostnummerET" value="<%= Request.Form("strPostnumme rET") %>" size="10"></td>
</tr>
<tr>
<td align="left" valign="top" class="body_fields">Postnu mmer 2 </td>
<td align="left" valign="top" class="body_fields"><input name="strPostnummerTO" type="text" id="strPostnummerTO" value="<%= Request.Form("strPostnumme rTO") %>" size="10"></td>
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Har sendt kvittering for ansøgning </td>
<td align="left" valign="top" class="body_fields"><input <%If (CStr(Request.Form("intKvi tto")) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%> name="intKvitto" type="checkbox" id="intKvitto" value="1"></td>
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Skal have afslag </td>
<td align="left" valign="top" class="body_fields"><input <%If (CStr(Request.Form("intAfs lag")) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%> name="intAfslag" type="checkbox" id="intAfslag" value="1"></td>
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Har fået afslag </td>
<td align="left" valign="top" class="body_fields"><input <%If (CStr(Request.Form("intAfs laaet")) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%> name="intAfslaaet" type="checkbox" id="intAfslaaet" value="1"></td>
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Skal i talentbank </td>
<td align="left" valign="top" class="body_fields"><input <%If (CStr(Request.Form("intTal entBank")) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%> name="intTalentBank" type="checkbox" id="intTalentBank" value="1"></td>
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Har gennemført telefoninterview </td>
<td align="left" valign="top" class="body_fields"><input <%If (CStr(Request.Form("intTlf Interview" )) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%> name="intTlfInterview" type="checkbox" id="intTlfInterview" value="1"></td>
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Har gennemført personligt interview </td>
<td align="left" valign="top" class="body_fields"><input <%If (CStr(Request.Form("intPer sInterview ")) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%> name="intPersInterview" type="checkbox" id="intPersInterview" value="1"></td>
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields"><input type="submit" name="Submit" value="Søg"> <input type="reset" name="Submit2" value="Annullér"></ td>
<td align="left" valign="top" class="body_fields">For at se ALLE - klik da på SØG uden at markere felter</td>
</tr>
</table>
                      </form>                       </td>                      </tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top" class="blue_background">Re sultatside (nyeste øverst) - klik på link (navn) for at redigere </td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top"><table width="100%" Â border="0" id="data">
<tr>
<td class="admin_normal">  ;</td>
<td class="admin_normal">Navn </td>
<td class="admin_normal">Alder </td>
<td class="admin_normal">Postn r.</td>
<td class="admin_normal">Kvitt .</td>
<td class="admin_normal">Afsl& aring;s</t d>
<td class="admin_normal">Afsl& aring;et</ td>
<td class="admin_normal">Talen t</td>
<td class="admin_normal">Tlf.i nt.</td>
<td class="admin_normal">Pers. int.</td>
<td class="admin_normal">Slet< /td>
</tr>
<% If Not RSCV.EOF Or Not RSCV.BOF Then %>
<%
While ((Repeat1__numRows <>Â 0) AND (NOT RSCV.EOF))
%>
<tr>
<td class="body_fields"><%
dim billede
billede = (RSCV.Fields.Item("strPic" ).Value)
if billede <>Â "" then
response.write("<img src=../images/camera.gif>" )
else
response.write("")
end if
%></td>
<td class="body_fields"><A HREF="cv_profile.asp?<%= Server.HTMLEncode(MM_keepN one) &Â MM_joinChar(MM_keepNone) &Â "ansogID=" &Â RSCV.Fields.Item("ansogID" ).Value %>"><%=(RSCV.Fields.Item(" strNavn"). Value)%></ A></td>
<td class="body_fields"><%=(RS CV.Fields. Item("strA lder").Val ue)%></td>
<td class="body_fields"><%=(RS CV.Fields. Item("strP ostnummer" ).Value)%> </td>
<td><input name="intKvitto" type="checkbox" id="intKvitto" value="1" <%If (CStr((RSCV.Fields.Item("i ntKvitto") .Value)) = CStr("1")) Then Response.Write("checked") : Response.Write("")%>></td>
<td><input name="intAfslag" type="checkbox" id="intAfslag" value="1" <%If (CStr((RSCV.Fields.Item("i ntAfslag") .Value)) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%>></td>
<td><input <%If (CStr((RSCV.Fields.Item("i ntAfslaaet ").Value)) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%> name="intAfslaaet" type="checkbox" id="intAfslaaet" value="1"></td>
<td><input <%If (CStr((RSCV.Fields.Item("i ntTalentBa nk").Value )) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%> name="intTalentbank" type="checkbox" id="intTalentbank" value="1"></td>
<td><input <%If (CStr((RSCV.Fields.Item("i ntTlfInter view").Val ue)) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%> name="intTlfinterview" type="checkbox" id="intTlfinterview" value="1"></td>
<td><input <%If (CStr((RSCV.Fields.Item("i ntPersInte rview").Va lue)) = CStr("1")) Then Response.Write("checked="" checked""" ) : Response.Write("")%> name="intPersinterview" type="checkbox" id="intPersinterview" value="1"></td>
<td class="body_fields"><A HREF="cv_delete_profile.as p?<%= Server.HTMLEncode(MM_keepN one) &Â MM_joinChar(MM_keepNone) &Â "ansogID=" &Â RSCV.Fields.Item("ansogID" ).Value %>">Slet</A></td>
</tr>
<%
Repeat1__index=Repeat1__in dex+1
Repeat1__numRows=Repeat1__ numRows-1
RSCV.MoveNext()
Wend
%>
<% End If ' end Not RSCV.EOF Or NOT RSCV.BOF %>
<% If RSCV.EOF And RSCV.BOF Then %>
<tr>
<td colspan="12" class="admin_delete">Der var ingen personer der matchede din søgning - venligst søg igen </td>
</tr>
<% End If ' end RSCV.EOF And RSCV.BOF %>
</table></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top"> </td>
</tr>
</table> Â Â Â Â Â </td>
<td width="10"> Â Â Â Â Â </td>
</tr>
<tr>
<td> Â Â Â Â Â </td>
<td align="left" valign="top"><%=request.qu erystring( RSCV.Sourc e)%></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="left" valign="top"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="left" valign="top"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="left" valign="top"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="left" valign="top"> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td align="left" valign="top" class="wastecolor" style="border-left: solid 1px #BBBEC9"> </td>
</tr>
</table>
</body>
</html>
<%
RSCV.Close()
Set RSCV = Nothing
%>
I would prefer if I can keep everything within Dreamweavers ability to edit via it's WYSIWYG interface.
Below is the WHOLE code:
<!--%@LANGUAGE="VBSCRIPT"%
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/connF
<%
Dim RSCV__soegNavn
RSCV__soegNavn = "0"
If (Request.Form("strNavn") Â Â Â <> "") Then
RSCV__soegNavn = Request.Form("strNavn") Â Â
End If
%>
<%
Dim RSCV__soegPostnummerET
RSCV__soegPostnummerET = "999999"
If (Request.Form("strPostnumm
RSCV__soegPostnummerET = Request.Form("strPostnumme
End If
%>
<%
Dim RSCV__soegPostnummerTO
RSCV__soegPostnummerTO = "9999999"
If (Request.Form("strPostnumm
RSCV__soegPostnummerTO = Request.Form("strPostnumme
End If
%>
<%
Dim RSCV__soegKvitto
RSCV__soegKvitto = "0"
If (Request.Form("intKvitto")
RSCV__soegKvitto = Request.Form("intKvitto")
End If
%>
<%
Dim RSCV__soegAfslag
RSCV__soegAfslag = "0"
If (Request.Form("intAfslag")
RSCV__soegAfslag = Request.Form("intAfslag")
End If
%>
<%
Dim RSCV__soegAfslaaet
RSCV__soegAfslaaet = "0"
If (Request.Form("intAfslaaet
RSCV__soegAfslaaet = Request.Form("intAfslaaet"
End If
%>
<%
Dim RSCV__soegTalentbank
RSCV__soegTalentbank = "0"
If (Request.Form("intTalentba
RSCV__soegTalentbank = Request.Form("intTalentban
End If
%>
<%
Dim RSCV__soegTlfinterview
RSCV__soegTlfinterview = "0"
If (Request.Form("intTlfinter
RSCV__soegTlfinterview = Request.Form("intTlfinterv
End If
%>
<%
Dim RSCV__soegPersinterview
RSCV__soegPersinterview = "0"
If (Request.Form("intPersInte
RSCV__soegPersinterview = Request.Form("intPersInter
End If
%>
<%
Dim RSCV
Dim RSCV_numRows
Set RSCV = Server.CreateObject("ADODB
RSCV.ActiveConnection = MM_connFeedback_STRING
RSCV.Source = "SELECT *  FROM tblAnsog  WHERE (strNavn LIKE '%" + Replace(RSCV__soegNavn, "'", "''") + "%') AND (strPostnummer BETWEEN (" + Replace(RSCV__soegPostnumm
RSCV.CursorType = 0
RSCV.CursorLocation = 2
RSCV.LockType = 1
RSCV.Open()
RSCV_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
RSCV_numRows = RSCV_numRows + Repeat1__numRows
%>
<%
' Â *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim RSCV_total
Dim RSCV_first
Dim RSCV_last
' set the record count
RSCV_total = RSCV.RecordCount
' set the number of rows displayed on this page
If (RSCV_numRows <Â 0) Then
RSCV_numRows = RSCV_total
Elseif (RSCV_numRows = 0) Then
RSCV_numRows = 1
End If
' set the first and last displayed record
RSCV_first = 1
RSCV_last  = RSCV_first + RSCV_numRows - 1
' if we have the correct record count, check the other stats
If (RSCV_total <>Â -1) Then
If (RSCV_first >Â RSCV_total) Then
RSCV_first = RSCV_total
End If
If (RSCV_last >Â RSCV_total) Then
RSCV_last = RSCV_total
End If
If (RSCV_numRows >Â RSCV_total) Then
RSCV_numRows = RSCV_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (RSCV_total = -1) Then
' count the total records by iterating through the recordset
RSCV_total=0
While (Not RSCV.EOF)
RSCV_total = RSCV_total + 1
RSCV.MoveNext
Wend
' reset the cursor to the beginning
If (RSCV.CursorType >Â 0) Then
RSCV.MoveFirst
Else
RSCV.Requery
End If
' set the number of rows displayed on this page
If (RSCV_numRows <Â 0 Or RSCV_numRows >Â RSCV_total) Then
RSCV_numRows = RSCV_total
End If
' set the first and last displayed record
RSCV_first = 1
RSCV_last = RSCV_first + RSCV_numRows - 1
If (RSCV_first >Â RSCV_total) Then
RSCV_first = RSCV_total
End If
If (RSCV_last >Â RSCV_total) Then
RSCV_last = RSCV_total
End If
End If
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <>Â "") Then
MM_removeList = MM_removeList &Â "&" &Â MM_paramName &Â "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&"Â & MM_item &Â "="
If (InStr(1,MM_removeList,MM_
MM_keepURL = MM_keepURL &Â MM_nextItem &Â Server.URLencode(Request.Q
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&"Â & MM_item &Â "="
If (InStr(1,MM_removeList,MM_
MM_keepForm = MM_keepForm &Â MM_nextItem &Â Server.URLencode(Request.F
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL &Â MM_keepForm
If (MM_keepBoth <>Â "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <>Â "") Â Then
MM_keepURL Â = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <>Â "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <>Â "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Admin modul</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="supercss.css" rel="stylesheet" type="text/css">
<script type="text/JavaScript">
<!--
function altRowColors(){ //v2.0
var args = arguments, obj, color0, color1, rowList;
for(var a = 0; a <Â args.length; a+=3){
obj = args[a+0]; color0 = args[a+1]; color1 = args[a+2];
obj = (isNaN(obj)) ? document.getElementById(ob
if(obj) rowList = obj.getElementsByTagName("
for(var i = 0; i <Â rowList.length; i++) rowList[i].style.backgroun
}
}
//-->
</script>
</head>
<body style="margin:0px; height:100%;" onLoad="altRowColors('data
<table width="100%" height="100%" Â cellpadding="0" cellspacing="0" border="0" style="position:absolute; top:0px; bottom:0px; left:0px; right:0px;">
<tr>
<td width="780" align="left" valign="top">
<table width="100%" Â border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" Â border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" class="bg_image"> </t
<td width="185" align="left" valign="top"><img src="images/logo.jpg" width="185" height="48"></td>
</tr>
<tr>
<td align="left" valign="top"><%= Request.Form("strNavn") %></td>
<td align="left" valign="top"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" Â border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10"> Â Â Â Â Â </td>
<td align="left" valign="top"><table width="100%" Â border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="150" align="left" valign="top"><table width="100%" Â border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="admin_fat"><a href="admin.asp">Hjem</a><
</tr>
<tr>
<td class="newstext"> </t
</tr>
<tr>
<td class="newstext"> </t
</tr>
</table></td>
<td align="left" valign="top"><table width="100%" border="0">
<tr>
<td class="newsheadline">Avanc
</tr>
<tr>
<td><form action="resultat_soeg.asp"
<table width="100%" border="0">
<tr>
<td align="left" valign="top" class="body_fields">Navn</
<td align="left" valign="top" class="body_fields"><input
</tr>
<tr>
<td align="left" valign="top" class="body_fields">Postnu
<td align="left" valign="top" class="body_fields"><input
</tr>
<tr>
<td align="left" valign="top" class="body_fields">Postnu
<td align="left" valign="top" class="body_fields"><input
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Har sendt kvittering for ansøgning </td>
<td align="left" valign="top" class="body_fields"><input
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Skal have afslag </td>
<td align="left" valign="top" class="body_fields"><input
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Har fået afslag </td>
<td align="left" valign="top" class="body_fields"><input
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Skal i talentbank </td>
<td align="left" valign="top" class="body_fields"><input
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Har gennemført telefoninterview </td>
<td align="left" valign="top" class="body_fields"><input
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields">Har gennemført personligt interview </td>
<td align="left" valign="top" class="body_fields"><input
</tr>
<tr>
<td width="200" align="left" valign="top" class="body_fields"><input
<td align="left" valign="top" class="body_fields">For at se ALLE - klik da på SØG uden at markere felter</td>
</tr>
</table>
                      </form>                       </td>                      </tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top" class="blue_background">Re
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top"><table width="100%" Â border="0" id="data">
<tr>
<td class="admin_normal"> 
<td class="admin_normal">Navn </td>
<td class="admin_normal">Alder
<td class="admin_normal">Postn
<td class="admin_normal">Kvitt
<td class="admin_normal">Afsl&
<td class="admin_normal">Afsl&
<td class="admin_normal">Talen
<td class="admin_normal">Tlf.i
<td class="admin_normal">Pers.
<td class="admin_normal">Slet<
</tr>
<% If Not RSCV.EOF Or Not RSCV.BOF Then %>
<%
While ((Repeat1__numRows <>Â 0) AND (NOT RSCV.EOF))
%>
<tr>
<td class="body_fields"><%
dim billede
billede = (RSCV.Fields.Item("strPic"
if billede <>Â "" then
response.write("<img src=../images/camera.gif>"
else
response.write("")
end if
%></td>
<td class="body_fields"><A HREF="cv_profile.asp?<%= Server.HTMLEncode(MM_keepN
<td class="body_fields"><%=(RS
<td class="body_fields"><%=(RS
<td><input name="intKvitto" type="checkbox" id="intKvitto" value="1" <%If (CStr((RSCV.Fields.Item("i
<td><input name="intAfslag" type="checkbox" id="intAfslag" value="1" <%If (CStr((RSCV.Fields.Item("i
<td><input <%If (CStr((RSCV.Fields.Item("i
<td><input <%If (CStr((RSCV.Fields.Item("i
<td><input <%If (CStr((RSCV.Fields.Item("i
<td><input <%If (CStr((RSCV.Fields.Item("i
<td class="body_fields"><A HREF="cv_delete_profile.as
</tr>
<%
Repeat1__index=Repeat1__in
Repeat1__numRows=Repeat1__
RSCV.MoveNext()
Wend
%>
<% End If ' end Not RSCV.EOF Or NOT RSCV.BOF %>
<% If RSCV.EOF And RSCV.BOF Then %>
<tr>
<td colspan="12" class="admin_delete">Der var ingen personer der matchede din søgning - venligst søg igen </td>
</tr>
<% End If ' end RSCV.EOF And RSCV.BOF %>
</table></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top"> </td>
</tr>
</table> Â Â Â Â Â </td>
<td width="10"> Â Â Â Â Â </td>
</tr>
<tr>
<td> Â Â Â Â Â </td>
<td align="left" valign="top"><%=request.qu
<td> </td>
</tr>
<tr>
<td> </td>
<td align="left" valign="top"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="left" valign="top"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="left" valign="top"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="left" valign="top"> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td align="left" valign="top" class="wastecolor" style="border-left: solid 1px #BBBEC9"> </td>
</tr>
</table>
</body>
</html>
<%
RSCV.Close()
Set RSCV = Nothing
%>
ASKER
The code is from the results page
Okay your logic (or rather dreamweaver's) is doing this;
Declare variable RSCV__soegNavn and set it to 0
If a name value is entered in the form, change value of RSCV__soegNavn to be that value entered, otherwise leave as 0
Select values from database where strNavn is like RSCV__soegNavn
Some debugging is needed here to find out why the value on the form is not being used. Â I need you to write the completed SELECT statement into the browser window before the search runs.
Find this line in your code (around line 74)
  RSCV.CursorType = 0
Before it write this line
  Response.Write("<hr/>" & RSCV.Source & "<hr/>")
This will show you the select statement that is being passed to the database. Â It will be enclosed in 2 horizontal rules. Â Copy that information and paste it into a reply so I can see whats happening.
Declare variable RSCV__soegNavn and set it to 0
If a name value is entered in the form, change value of RSCV__soegNavn to be that value entered, otherwise leave as 0
Select values from database where strNavn is like RSCV__soegNavn
Some debugging is needed here to find out why the value on the form is not being used. Â I need you to write the completed SELECT statement into the browser window before the search runs.
Find this line in your code (around line 74)
  RSCV.CursorType = 0
Before it write this line
  Response.Write("<hr/>" & RSCV.Source & "<hr/>")
This will show you the select statement that is being passed to the database. Â It will be enclosed in 2 horizontal rules. Â Copy that information and paste it into a reply so I can see whats happening.
ASKER
Hi again. Thanks a lot for your time.
Here is what the search read.
SELECT * FROM tblAnsog WHERE (strNavn LIKE '%Johnny%') AND (strPostnummer BETWEEN (999999) AND (9999999)) AND ((intKvitto = 1 and 0 = 1) OR 0 = 0) AND ((intAfslag = 1 AND 0 = 1) OR 0 = 0) AND ((intAfslaaet = 1 and 0 = 1) OR 0 = 0) AND ((intTalentbank = 1 and 0 = 1) OR 0 = 0) AND ((intTlfinterview = 1 and 0 = 1) OR 0 = 0) AND ((intPersinterview = 1 and 0 = 1) OR 0 = 0) ORDER BY strPostnummer ASC
The search was a success but I guess all them ANDs and ORs are to blame?
Here is what the search read.
SELECT * FROM tblAnsog WHERE (strNavn LIKE '%Johnny%') AND (strPostnummer BETWEEN (999999) AND (9999999)) AND ((intKvitto = 1 and 0 = 1) OR 0 = 0) AND ((intAfslag = 1 AND 0 = 1) OR 0 = 0) AND ((intAfslaaet = 1 and 0 = 1) OR 0 = 0) AND ((intTalentbank = 1 and 0 = 1) OR 0 = 0) AND ((intTlfinterview = 1 and 0 = 1) OR 0 = 0) AND ((intPersinterview = 1 and 0 = 1) OR 0 = 0) ORDER BY strPostnummer ASC
The search was a success but I guess all them ANDs and ORs are to blame?
>>The search was a success but I guess all them ANDs and ORs are to blame?
That depends on what you wanted to happen! Â The OR's are actually in brackets which means they are not directly influencing the results. Â The AND's are the important part here. Â Here's the statement broken down making it easier to read:
SELECT * FROM tblAnsog WHERE (strNavn LIKE '%Johnny%')
 AND (strPostnummer BETWEEN (999999) AND (9999999))
 AND ((intKvitto = 1 and 0 = 1) OR 0 = 0)
 AND ((intAfslag = 1 AND 0 = 1) OR 0 = 0)
 AND ((intAfslaaet = 1 and 0 = 1) OR 0 = 0)
 AND ((intTalentbank = 1 and 0 = 1) OR 0 = 0)
 AND ((intTlfinterview = 1 and 0 = 1) OR 0 = 0)
 AND ((intPersinterview = 1 and 0 = 1) OR 0 = 0)
ORDER BY strPostnummer ASC
Every single one of those AND statements much match before the search finds anything. Â Therefore, its actually working because if it found Johnny's name then "Johnny" was definitely being searched for from the form.
If you miss "Johnny" out it won't find anything because it will resort back to strNavn = 0, and create a search command like this:
SELECT * FROM tblAnsog WHERE (strNavn LIKE '%0%')
 AND (strPostnummer BETWEEN (999999) AND .......................... ... etc etc
therefore only finding names containing the value 0.
That depends on what you wanted to happen! Â The OR's are actually in brackets which means they are not directly influencing the results. Â The AND's are the important part here. Â Here's the statement broken down making it easier to read:
SELECT * FROM tblAnsog WHERE (strNavn LIKE '%Johnny%')
 AND (strPostnummer BETWEEN (999999) AND (9999999))
 AND ((intKvitto = 1 and 0 = 1) OR 0 = 0)
 AND ((intAfslag = 1 AND 0 = 1) OR 0 = 0)
 AND ((intAfslaaet = 1 and 0 = 1) OR 0 = 0)
 AND ((intTalentbank = 1 and 0 = 1) OR 0 = 0)
 AND ((intTlfinterview = 1 and 0 = 1) OR 0 = 0)
 AND ((intPersinterview = 1 and 0 = 1) OR 0 = 0)
ORDER BY strPostnummer ASC
Every single one of those AND statements much match before the search finds anything. Â Therefore, its actually working because if it found Johnny's name then "Johnny" was definitely being searched for from the form.
If you miss "Johnny" out it won't find anything because it will resort back to strNavn = 0, and create a search command like this:
SELECT * FROM tblAnsog WHERE (strNavn LIKE '%0%')
 AND (strPostnummer BETWEEN (999999) AND ..........................
therefore only finding names containing the value 0.
ASKER
OK - what I wanted to happen that I wanted to find any name called Johnny - even though I didnt search in any other fields. But my search didnt match anything :/
So basically I want the search to display results even if I don't fill out any search fields.
So basically I want the search to display results even if I don't fill out any search fields.
In that case you would change the AND's to OR's, so that the rest of the search is not necessary. Â Try this (but backup the original first!):
SELECT * FROM tblAnsog WHERE (strNavn LIKE '%Johnny%')
OR
((strPostnummer BETWEEN (999999) AND (9999999))
 AND ((intKvitto = 1 and 0 = 1) OR 0 = 0)
 AND ((intAfslag = 1 AND 0 = 1) OR 0 = 0)
 AND ((intAfslaaet = 1 and 0 = 1) OR 0 = 0)
 AND ((intTalentbank = 1 and 0 = 1) OR 0 = 0)
 AND ((intTlfinterview = 1 and 0 = 1) OR 0 = 0)
 AND ((intPersinterview = 1 and 0 = 1) OR 0 = 0))
ORDER BY strPostnummer ASC
Dreamweaver isn't very clever at doing anything but simple searches, so eventually you've got no choice but to get stuck in and learn how to do the searches yourself.
Within the search dialog, just paste my attempt above over the top of whatever dreamweaver currently has. Â You might have to go into Expert mode.
SELECT * FROM tblAnsog WHERE (strNavn LIKE '%Johnny%')
OR
((strPostnummer BETWEEN (999999) AND (9999999))
 AND ((intKvitto = 1 and 0 = 1) OR 0 = 0)
 AND ((intAfslag = 1 AND 0 = 1) OR 0 = 0)
 AND ((intAfslaaet = 1 and 0 = 1) OR 0 = 0)
 AND ((intTalentbank = 1 and 0 = 1) OR 0 = 0)
 AND ((intTlfinterview = 1 and 0 = 1) OR 0 = 0)
 AND ((intPersinterview = 1 and 0 = 1) OR 0 = 0))
ORDER BY strPostnummer ASC
Dreamweaver isn't very clever at doing anything but simple searches, so eventually you've got no choice but to get stuck in and learn how to do the searches yourself.
Within the search dialog, just paste my attempt above over the top of whatever dreamweaver currently has. Â You might have to go into Expert mode.
ASKER
Thx for your advice - I'll try it tomorrow at this time.
ASKER
How odd - I changed the SQL as you asked me to but the search gave me this result when I searched for Johnny:
SELECT * FROM tblAnsog WHERE (strNavn LIKE '%0%') OR (strPostnummer BETWEEN (999999) AND (9999999)) AND ((intKvitto = 1 and 0 = 1) OR 0 = 0) AND ((intAfslag = 1 AND 0 = 1) OR 0 = 0) AND ((intAfslaaet = 1 and 0 = 1) OR 0 = 0) AND ((intTalentbank = 1 and 0 = 1) OR 0 = 0) AND ((intTlfinterview = 1 and 0 = 1) OR 0 = 0) AND ((intPersinterview = 1 and 0 = 1) OR 0 = 0) ORDER BY strPostnummer ASC
and the result is still no matches (but of course there is a matching name in my database)...
SELECT * FROM tblAnsog WHERE (strNavn LIKE '%0%') OR (strPostnummer BETWEEN (999999) AND (9999999)) AND ((intKvitto = 1 and 0 = 1) OR 0 = 0) AND ((intAfslag = 1 AND 0 = 1) OR 0 = 0) AND ((intAfslaaet = 1 and 0 = 1) OR 0 = 0) AND ((intTalentbank = 1 and 0 = 1) OR 0 = 0) AND ((intTlfinterview = 1 and 0 = 1) OR 0 = 0) AND ((intPersinterview = 1 and 0 = 1) OR 0 = 0) ORDER BY strPostnummer ASC
and the result is still no matches (but of course there is a matching name in my database)...
This might be because I didn't convert the SQL back to the format dreamweaver was expecting it. Â Go to the line that starts with:
  RSCV.Source =
and replace it with this statement:
RSCV.Source = "SELECT *  FROM tblAnsog  WHERE (strNavn LIKE '%" + Replace(RSCV__soegNavn, "'", "''") + "%') OR ((strPostnummer BETWEEN (" + Replace(RSCV__soegPostnumm erET, "'", "''") + ") AND (" + Replace(RSCV__soegPostnumm erTO, "'", "''") + ")) AND ((intKvitto = 1 and " + Replace(RSCV__soegKvitto, "'", "''") + " = 1) OR " + Replace(RSCV__soegKvitto, "'", "''") + " = 0) AND ((intAfslag = 1 AND " + Replace(RSCV__soegAfslag, "'", "''") + " = 1) OR " + Replace(RSCV__soegAfslag, "'", "''") + " = 0) AND ((intAfslaaet = 1 and " + Replace(RSCV__soegAfslaaet , "'", "''") + " = 1) OR " + Replace(RSCV__soegAfslaaet , "'", "''") + " = 0) AND ((intTalentbank = 1  and " + Replace(RSCV__soegTalentba nk, "'", "''") + " = 1) OR " + Replace(RSCV__soegTalentba nk, "'", "''") + " = 0) AND ((intTlfinterview = 1  and " + Replace(RSCV__soegTlfinter view, "'", "''") + " = 1) OR " + Replace(RSCV__soegTlfinter view, "'", "''") + " = 0) AND ((intPersinterview = 1  and " + Replace(RSCV__soegPersinte rview, "'", "''") + " = 1) OR " + Replace(RSCV__soegPersinte rview, "'", "''") + " = 0))  ORDER BY strPostnummer ASC"
If this doesn't work then we're going to have to use 2 sql statements and select one depending on what form values are selected.
  RSCV.Source =
and replace it with this statement:
RSCV.Source = "SELECT *  FROM tblAnsog  WHERE (strNavn LIKE '%" + Replace(RSCV__soegNavn, "'", "''") + "%') OR ((strPostnummer BETWEEN (" + Replace(RSCV__soegPostnumm
If this doesn't work then we're going to have to use 2 sql statements and select one depending on what form values are selected.
ASKER
Sorry - didn't work :(
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
will do - haven't got the time today. I'll get back to you.
ASKER
No experts?