codice:
<%
testo = Request("chiavericerca")
'apro la connessione con il db
set myConn1 = server.CreateObject("ADODB.Connection")
dim strConnDb1
strConnDb1 = ""
strConnDb1 = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & server.mappath("/mdb-database/news.mdb")
myConn1.Open(strConnDb1)
mySqlSelect1 = "SELECT * from notizie WHERE titolo LIKE '%"& testo &"%'OR argomento LIKE '%"& testo &"%' order by data desc"
set myRSComS1 = server.CreateObject("ADODB.Recordset")
myRSComS1.Open mySqlSelect1, myConn1
if not(myRSComS1.EOF) and not(myRSComS1.BOF) then
do while not(myRSComS1.EOF)
%>
<table width="500" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td>
<font face="verdana" size="2" color="#FF0000">
<font color="#05326f"><%=myRSComS1("data")%></font><%=myRSComS1("titolo")%>
</font>
</td>
</tr>
<tr>
<td>
<p align="justify">
<font face="verdana" size="2" color="#000000">
<%
Testoparziale=""
Testoparziale=myRSComS1("argomento")
pos=150
response.write(left(Testoparziale, pos) &"... [Continua]")
%>
</font></p>
</td>
</tr>
</table>
<table width="500" height="10" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td></td>
</tr>
</table>
<%
myRSComS1.MoveNext
loop
else
%>
<table width="500" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td>
<p align="justify">
<font face="verdana" size="2" color="#000000">
La ricerca che avete efettuato non ha dato esiti; le parole da voi inserte non risultino all'interno di nessuna notizia.
</font></p>
</td>
</tr>
</table>
<table width="500" height="10" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td></td>
</tr>
</table>
<%
end if
myRSComS1.Close
set myRSComS1=nothing
myConn1.Close
set myConn1=nothing
%>
come da titolo mi potreste dare un'occhiata alla query e soprattutto alla procedura in generico per capire se come esito ottengo quello di visualizzare in maniera parziale tutti i record i cui campi titolo e argomento abbiano la parola o parte della parola cercata?
Grazie