Salve ho il seguente form per la ricerca di dati in un DB:
<form action="elenco_locali.asp" method="post" id="form1" name="form1">
<font face="Verdana" size="2">
<input type="checkbox" name="chkAutore" value="yes">
per Autore <input type="text" name="strAutore" size="20" class="txt7n_nero"><br>
<input type="checkbox" name="chkTitolo" value="yes">
per Titolo <input type="text" name="strTitolo" size="20" class="txt7n_nero"><br>
<input type="checkbox" name="chkVoce" value="yes">
per Voce <input type="text" name="strVoce" size="20" class="txt7n_nero"><br>
<input type="checkbox" name="chkSottovoce" value="yes">
per Sottovoce <input type="text" name="strSottovoce" size="20" class="txt7n_nero"><br>
<input type="checkbox" name="chkRivista" value="yes">
per Rivista <input type="text" name="strRivista" size="20" class="txt7n_nero"><br>
<input type="checkbox" name="chkCat" value="yes">
Nell'anno:
<select name="intCat">
<option value="1">2001
<option value="2">2000
<option value="3">2002
<option value="4">1999
<option value="5">2003
</select>
<p>
<input type="submit" value="Invia" id="submit1" name="submit1"></font>
</form>
quando effettuo una ricerca mi indirizza nella pagina dei risultati e mi da il seguente errore per tutti i campi richiesti:
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
/locali/searchAction.asp, line 91
line 91 = <%= rsArt("Voce") %>
------------------codice pagina risultati------------------
<%@ Language=VBScript %>
<% pageTitle = "Search Action" %>
<!--#include file="adovbs.inc"-->
<!--#include file="db.asp"-->
<%
'******************************************************
'Copyright©2000-2001 OliWeb
'******************************************************
'BEGINNING OF SEARCH CODE
'Assign and retrieve form variables from the search page
chkAutore = Request.form("chkAutore")
strAutore = Request.form("strAutore")
chkTitolo = Request.form("chkTitolo")
strTitolo = Request.form("strTitolo")
chkVoce = Request.form("chkVoce")
strVoce = Request.form("strVoce")
chkSottovoce = Request.form("chkSottovoce")
strSottovoce = Request.form("strSottovoce")
chkRivista = Request.form("chkRivista")
strRivista = Request.form("strRivista")
chkCat = Request.form("chkCat")
intCat = Request.form("intCat")
strAutore = ""
strTitolo = ""
strVoce = ""
strSottovoce = ""
strRivista = ""
intCatWhere = ""
if chkCat = "yes" then
intCatWhere = " and artic.annoID = '" &strCat&"'"
end if
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConString
sqlText = "select distinct(artic.ID), "
sqlText = sqlText & "artic.Autore "
sqlText = sqlText & "from artic "
sqlText = sqlText & "where artic.ID = "
sqlText = sqlText & "artic.ID"
sqlText = sqlText & strAutore & strTitolo & strVoce & strSottovoce & strRivista & intCatWhere
%>
<style type="text/css">
<!--
a:link { color: #808080 }
a:visited { color: #808080 }
a:hover { color: #ff9900 }
-->
</style>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="#808080">
<basefont face="Verdana" size="2">
<hr color="#CCCCCC" size="1" noshade>
<table border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" width="625">
<tr>
<td width="128" valign="top" align="center">
<td width="1" bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1" alt border="0"></td>
<td align="left" valign="top"><table border="0" cellspacing="4" cellpadding="4"><tr><td>
<p><font face="Arial" size="4"><b>Risultato della tua ricerca:</b></font></p>
<b><%
set rsArt = Conn.Execute(sqlText)
If rsArt.BOF And rsArt.EOF Then
Response.Write "<font face='Verdana' size='2'><strong>"
Response.Write "No items found, please narrow your <a href='search.asp'>search.</a></b>"
end if
while not rsArt.EOF
%>
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<td>Voce</td>
<td>Sottovoce</td>
<td>Autore</td>
<td>Titolo</td>
<td>Rivista</td>
<td>Anno</td>
<td>Pagina</td>
</tr>
<tr>
<td><%= rsArt("Voce") %></td>
<td><%= rsArt("Sottovoce") %></td>
<td><%= rsArt("Autore") %></td>
<td><%= rsArt("Titolo") %></td>
<td><%= rsArt("Rivista") %></td>
<td><%= rsArt("Anno") %></td>
<td><%= rsArt("Pagina") %></td>
</tr>
</table>
<%
rsArt.MoveNext
wend
rsArt.Close
set rsArt = Nothing
Conn.Close
set Conn = Nothing
%>
</b>
</td>
</tr>
</table>
</td>
</tr>
</table>
<hr color="#CCCCCC" size="1" noshade>
</body>
</html>
-------------------fine codice--------------
Mi visualizza solo il campo dell'autore e gli altri no. Perchè?
come posso risolvere il problema?
Grazie.