<%
dim x, strSQL, oRicerca, nK, strConn, EXT, aTMP, strTMP, strOP, page, recordsPerPagina, pag, rivista
RecordsPerPagina = 5
page = Request("page")
if page="" then page=1
set x = createobject("ADODB.connection")
set oRicerca = createobject("ADODB.recordset")
x.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("../annals/db/CatalogoRiviste.mdb")
response.write " Meditline Pubblication Search Engine"
response.write ""
response.write " "
response.write ""
response.write " "
response.write " "
response.write " Meditline Pubblication Search Engine "
response.write " Database description: Search abstracts for Medit-Line "
response.write " "
if request("advanced") = "1" then
if request("rivista")="1" then
rivista = "2"
else
rivista = request("rivista")
end if
response.write " "
response.write " "
response.write " "
if request("action")="search" then
strSQL = "SELECT * FROM qrySearch WHERE true"
if request("advanced") = "1" then
if request("titolo")<>"" then
aTMP=split(rtrim(request("titolo"))," ")
strTMP = "titolo like '%" & aTMP(0) & "%'"
for nk = 1 to ubound(aTMP)
if mid(aTMP(nk),1,1)="+" then
strOP = " AND "
atmp(nk) = mid(aTMP(nk),2)
elseif mid(aTMP(nk),1,1)="-" then
strOP = " AND NOT "
atmp(nk) = mid(aTMP(nk),2)
else
strOP = " OR "
end if
strTMP = strTMP & strOP & " titolo like '%" & aTMP(nk) & "%'"
next
strsql = strsql & " AND (" & strTMP & ")"
end if
else
if request("content")<>"" then
aTMP=split(rtrim(request("content"))," ")
strTMP = "titolo like '%" & aTMP(0) & "%'"
for nk = 1 to ubound(aTMP)
if mid(aTMP(nk),1,1)="+" then
strOP = " AND "
atmp(nk) = mid(aTMP(nk),2)
elseif mid(aTMP(nk),1,1)="-" then
strOP = " AND NOT "
atmp(nk) = mid(aTMP(nk),2)
else
strOP = " OR "
end if
strTMP = strTMP & strOP & " titolo like '%" & aTMP(nk) & "%'"
next
strsql = strsql & " AND ((" & strTMP & ")"
end if
end if
if request("content")<>"" then
if request("advanced") = 1 then
aTMP=split(rtrim(request("content"))," ")
strTMP = "sommario like '%" & aTMP(0) & "%'"
for nk = 1 to ubound(aTMP)
if mid(aTMP(nk),1,1)="+" then
strOP = " AND "
atmp(nk) = mid(aTMP(nk),2)
elseif mid(aTMP(nk),1,1)="-" then
strOP = " AND NOT "
atmp(nk) = mid(aTMP(nk),2)
else
strOP = " OR "
end if
strTMP = strTMP & strOP & " sommario like '%" & aTMP(nk) & "%'"
next
strsql = strsql & " AND (" & strTMP & ")"
else
aTMP=split(rtrim(request("content"))," ")
strTMP = "sommario like '%" & aTMP(0) & "%'"
for nk = 1 to ubound(aTMP)
if mid(aTMP(nk),1,1)="+" then
strOP = " AND "
atmp(nk) = mid(aTMP(nk),2)
elseif mid(aTMP(nk),1,1)="-" then
strOP = " AND NOT "
atmp(nk) = mid(aTMP(nk),2)
else
strOP = " OR "
end if
strTMP = strTMP & strOP & " sommario like '%" & aTMP(nk) & "%'"
next
strsql = strsql & " OR (" & strTMP & "))"
end if
end if
if request("Autore")<>"" then
aTMP=split(rtrim(request("autore"))," ")
strTMP = "autori like '%" & aTMP(0) & "%'"
for nk = 1 to ubound(aTMP)
if mid(aTMP(nk),1,1)="+" then
strOP = " AND "
atmp(nk) = mid(aTMP(nk),2)
elseif mid(aTMP(nk),1,1)="-" then
strOP = " AND NOT "
atmp(nk) = mid(aTMP(nk),2)
else
strOP = " OR "
end if
strTMP = strTMP & strOP & " autori like '%" & aTMP(nk) & "%'"
next
strsql = strsql & " AND (" & strTMP & ")"
end if
if request("advanced") = "1" then
if request("rivista") <> "0" then
strsql = strsql & " AND idRivista = " & rivista
end if
if request("nRiv1")<>"" then
strsql = strsql & " AND idNumeroRivista >= " & request("nRiv1")
end if
if request("nRiv2")<>"" then
strsql = strsql & " AND idNumeroRivista <= " & request("nRiv2")
end if
else
strsql = strsql & " AND (idRivista = 2 or idRivista = 3 or idRivista = 5 or idRivista = 6 or idRivista = 8)"
end if
oRicerca.open strSQL,x,1,3
If oRicerca.Eof=True then
Response.Write "Nothing "
Else
oRicerca.PageSize = RecordsPerPagina
oRicerca.AbsolutePage = page
response.write ""
End if
end if
response.write " | "
response.write " "
response.write " "
response.write " "
response.write " "
%>
|