|


| |
<%
ricerca1 = "comodato"
ricerca2 = "spes"
Dim StrConn, totali, i, SQL
StrConn = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " &_
Server.MapPath("/fpdb/consgra.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn
SQL = "SELECT Domanda1, Domanda2, DataDomanda, Risposta " &_
"FROM Gratuita " &_
"WHERE Interessante = 1 " &_
"AND Risposta <> '0' " &_
"AND (Domanda1 LIKE '%" & ricerca1 & "%' " &_
"OR Risposta LIKE '%" & ricerca1 & "%' " &_
"OR Domanda2 LIKE '%" & ricerca1 & "%') " &_
"AND (Domanda1 LIKE '%" & ricerca2 & "%' " &_
"OR Risposta LIKE '%" & ricerca2 & "%' " &_
"OR Domanda2 LIKE '%" & ricerca2 & "%') " &_
"ORDER BY DataDomanda DESC"
set rs = Conn.Execute (SQL)
If NOT rs.EOF Then
Elenco = rs.GetRows
totali = UBound(Elenco,2) + 1
n = 0
For i = 0 to totali - 1
n = n + 1
response.write "Domanda : " & TOGLI(Elenco(0, i)) & TOGLI(Elenco(1, i)) & "
"
response.write "Risposta : " & TOGLI(Elenco(3, i)) & " "
response.write "Data : " & Elenco(2, i) & " "
Next
response.write "Sono state trovate " & n & " domande."
' liberiamo le risorse
Set Elenco = Nothing
Rs.Close
Set Rs = Nothing
Conn.Close
set conn = Nothing
Else
Response.Write "Spiacente nessun risultato! Seleziona una parola chiave da cercare nel database delle consulenze gratuite"
End If
%>

|