ciao a tutti ho un problema che non riesco a risolvere... ho una pagina .asp in cui è presente una textbox e un bottone. Nella text box deve essere inserito un testo e quando clicco il bottone il testo scritto deve essere cercato nei campi di una tabella access e alla fine stampare i record della tabella in cui è presente. Ho già scritto un pezzo di codice ma non riesco a andare avanti.
codice:
<%
var ricerca = new String(Request.QueryString("ricerca"));
var parole = new String(Request.Form("stringa"));
var simbolo = parole.replace(/'/g,"''");
var stringa = simbolo.split(" ");
if (ricerca == "OK")
{
if (parole == "" || parole == "undefined")
{
Response.Write("<p>Inserisci unaa parola da ricercare</p>");
}
else
{
var Conn = new ActiveXObject("ADODB.Connection");
Conn.Open("driver={Microsoft Access Driver (*.mdb)};dbq=" + Server.MapPath("../database/programma.mdb"));
Lettera=Request("Lettera")
Mittente=Request("Mittente")
Destinatario=Request("A")
Oggetto=Request("Oggetto")
Testo=Request("Testo")
var sql="SELECT * FROM tabella WHERE Lettera LIKE '"%stringa%"' or Mittente LIKE '"%stringa%"' or Destinatario LIKE '"%stringa%"' or Oggetto LIKE '"%stringa%"' or Testo LIKE '"%stringa%"' "
var Mostra = Conn.Execute(sql);
if (Mostra.EOF)
{
Response.Write("<p>Niente</p>");
}
else
%>
codice:
<td >Risultato</td>
</tr>
<%
{
while (!Mostra.EOF)
{
with (Response)
{
%>
<tr>
Qualcuno potrebbe darmi una mano ?
Grazie