Prima di tutto grazie per l'aiuto!
mi dà questo errore
codice:
Microsoft JScript runtime error '800a138f'
Object expected
/biblio/ricerca.asp, line 62
dove sbaglio?
Questa è la pagina
codice:
<%@LANGUAGE = JScript%>
<html>
<head>
<title>Cerca nel catalogo della Biblioteca</title>
<style type="text/css">
<!--
.Stile1 {font-family: "ms Reference Sans Serif", Arial, tahoma}
.Stile2 {
font-size: 12px;
color: #0000FF;
}
body {
background-color: #6C7AA1;
}
.Stile4 {font-size: 12px}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body class="Stile1">
<h3 align="center">Cerca nel catalogo della nostra Biblioteca</h3>
<h3></h3>
<form action="ricerca.asp?cerca=OK" method="POST" class="Stile2">
<div align="center">
[img]../Immagini/Libro-specchio.jpg[/img]
<input type="text" name="stringa">
</p>
<input type="radio" name="campo" value="titolo" checked>
Titolo
<input type="radio" name="campo" value="autore">
Autore
<input type="radio" name="campo" value="editore">
Editore</p>
<input name="submit" type="submit" value="Cerca">
<%
var cerca = new String(Request.QueryString("cerca"));
var testo = new String(Request.Form("stringa"));
var apice = testo.replace(/'/g,"''");
var stringa = apice.split(" ");
if (cerca == "OK")
{
if (testo == "" || testo == "undefined")
{
Response.Write("
Inserire almeno una parola per effettuare una ricerca</p>");
}
else
{
var Cn = new ActiveXObject("ADODB.Connection");
Cn.Open("driver={Microsoft Access Driver (*.mdb)};dbq=" + Server.MapPath("/mdb-database/biblio.mdb"));
var sql = "SELECT * FROM catalogo WHERE";
for (var i=0; i<stringa.length; i++)
{
if (i > 0)
{
sql += " AND";
}
var campo = new String(Request.Form("campo"));
SQL += campo + " LIKE '%" + stringa[i] + "%'";
}
var Mostra = Cn.Execute(sql);
if (Mostra.EOF)
{
Response.Write("
Nessun risultato</p>");
}
else
{
while (!Mostra.EOF)
{
with (Response)
{
Write("
");
Write("" +Mostra("titolo") + "
");
Write(("Editore: ") + Mostra("Editore"));
Write("
");
Write(("Autore: ") + Mostra("Autore") + (" ") +Mostra ("Anno"));
Write("</p>");
Write ("<hr>")
Mostra.MoveNext();
}
}
}
Cn.Close();
}
}
%>
</p>
</p>
</div>
</form>
<span class="Stile2"></span>
</body>
</html>
grazie ancora