|
hhammash -> RE: Multi Select - Rdouglas (12/28/2002 13:40:39)
|
Hi rgdouglas, I tried the code, it is almost working, but I am gettin this error: quote:
Database Results Error Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ' Country IN ( ,' UK' ,' Sweden' ,' Germany' )' . Number: -2147217900 (0x80040E14) Source: Microsoft OLE DB Provider for ODBC Drivers Here is the full page: <html>
<head>
<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>Country</title>
</head>
<body>
<form BOTID=" 0" METHOD=" POST" ACTION=" Search3.asp" >
<table BORDER=" 0" >
<tr>
<td><b>Country</b></td>
<td><nobr>
<!--#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 %>
<%
fp_sQry=" SELECT * FROM Customers"
fp_sDefault=" "
fp_sNoRecords=" No records returned."
fp_sDataConn=" Customers"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice=" Country"
fp_sMenuValue=" Country"
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<select NAME=" Country" SIZE=" 6" multiple>
<!--#include file=" ../_fpclass/fpdbrgn1.inc" -->
<option><%=FP_FieldHTML(fp_rs," Country" )%></option>
<!--#include file=" ../_fpclass/fpdbrgn2.inc" -->
</select>
</nobr></td>
</tr>
</table>
<p><br>
<input TYPE=" Submit" ><input TYPE=" Reset" >
</p>
<p> </p>
</form>
<table width=" 100%" border=" 1" >
<thead>
<tr>
<td><b>CustomerID</b></td>
<td><b>CompanyName</b></td>
<td><b>ContactTitle</b></td>
<td><b>Country</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 %>
<% DIM CountryArray, myString
CountryArray = split(Request.Form(" Country" )," ," )
myString = " "
FOR x = 0 to UBound(CountryArray)
myString = myString & " ,' " & CountryArray(x) & " ' "
NEXT
%>
<%
fp_sQry=" SELECT * FROM Customers WHERE Country IN (" & myString & " )"
fp_sDefault=" Country="
fp_sNoRecords=" <tr><td colspan=4 align=left width=" " 100%" " >No records returned.</td></tr>"
fp_sDataConn=" Customers"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=" "
fp_sMenuValue=" "
fp_iDisplayCols=4
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file=" ../_fpclass/fpdbrgn1.inc" -->
<!--webbot bot=" DatabaseRegionStart" endspan i-checksum=" 49162" --><tr>
<td>
<%=FP_FieldVal(fp_rs," CustomerID" )%> </td>
<td>
<%=FP_FieldVal(fp_rs," CompanyName" )%> </td>
<td>
<%=FP_FieldVal(fp_rs," ContactTitle" )%> </td>
<td>
<%=FP_FieldVal(fp_rs," Country" )%> </td>
</tr>
<!--#include file=" ../_fpclass/fpdbrgn2.inc" -->
</tbody>
</table>
</body>
</html>
Where did I do wrong. Thanks a lot Hisham
|
|
|
|