tipo=Request.form("r1")
anno2=Request.form("anno")
numeroda=Request.form("numeroda")
numeroa=Request.form("numeroa")
oggetto=Request.form("oggetto")
datada=Request.form("giornodatada") + "/" + Request.form("mesedatada") + "/" + Request.form("annodatada")
dataa=Request.form("giornodataa") + "/" + Request.form("mesedataa") + "/" + Request.form("annodataa")
if dataa = "gg/mm/yyyy" then
dataa = datada
pubblicazioneda=Request.form("giornopubblicazioned a") + "/" + Request.form("mesepubblicazioneda") + "/" + Request.form("annopubblicazioneda")
pubblicazionea=Request.form("giornopubblicazionea" ) + "/" + Request.form("mesepubblicazionea") + "/" + Request.form("annopubblicazionea")
if pubblicazionea = "gg/mm/yyyy" then
pubblicazionea = pubblicazioneda
esecutivada=Request.form("giornoesecutivada") + "/" + Request.form("meseesecutivada") + "/" + Request.form("annoesecutivada")
esecutivaa=Request.form("giornoesecutivaa") + "/" + Request.form("meseesecutivaa") + "/" + Request.form("annoesecutivaa")
if esecutivaa = "gg/mm/yyyy" then
esecutivaa = esecutivada
oggetto=Request.form("oggetto")
end if
end if
end if
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("mdb-database/laigueglia.mdb")
sql ="SELECT id FROM documenti where tipo = '" & tipo & "' and anno = '" & anno & "'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
Do While Not rs.Eof
a = rs.fields("id")
if numeroda <> "" then
sql2 ="SELECT id FROM documenti where numero between '" & numeroda & "' and '" & numeroa & "' and id = "' & a & "'"
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.Open sql2, conn, 3, 3
b = rs.fields("id")
else
sql2 ="SELECT id FROM documenti id = "' & a & "'"
rs2.Open sql2, conn, 3, 3
b = rs.fields("id")
if oggetto <> "" then
sql3 ="SELECT id FROM documenti where oggetto like '" & oggetto & "' and id = "' & b & "'"
Set rs3 = Server.CreateObject("ADODB.Recordset")
rs3.Open sql3, conn, 3, 3
c = rs.fields("id")
else
sql3 ="SELECT id FROM documenti id = "' & b & "'"
rs3.Open sql3, conn, 3, 3
c = rs.fields("id")
if datada <> "gg/mm/yyyy" then
sql4 ="SELECT id FROM documenti where data between '" & datada & "' and '" & dataa & "' and id = "' & c & "'"
Set rs4 = Server.CreateObject("ADODB.Recordset")
rs4.Open sql4, conn, 3, 3
d = rs.fields("id")
else
sql4 ="SELECT id FROM documenti id = "' & c & "'"
rs4.Open sql4, conn, 3, 3
d = rs.fields("id")
if pubblicazioneda <> "gg/mm/yyyy" then
sql5 ="SELECT id FROM documenti where datapubbl between '" & pubblicazioneda & "' and '" & pubblicazionea & "' and id = "' & c & "'"
Set rs5 = Server.CreateObject("ADODB.Recordset")
rs5.Open sql5, conn, 3, 3
e = rs.fields("id")
else
sql5 ="SELECT id FROM documenti id = "' & d & "'"
rs5.Open sql5, conn, 3, 3
e = rs.fields("id")
if esecutivada <> "gg/mm/yyyy" then
sql6 ="SELECT id FROM documenti where dataesec between '" & esecutivada & "' and '" & esecutivaa & "' and id = "' & d & "'"
Set rs6 = Server.CreateObject("ADODB.Recordset")
rs6.Open sql6, conn, 3, 3
f = rs.fields("id")
else
sql6 ="SELECT id FROM documenti id = "' & d & "'"
rs6.Open sql6, conn, 3, 3
f = rs.fields("id")
response.write f
rs.movenext
loop
end if
end if
end if
end if
end if
end if
Rs.Close
Set RS = Nothing
Rs1.Close
Set RS1 = Nothing
Rs2.Close
Set RS2 = Nothing
Rs3.Close
Set RS3 = Nothing
Rs4.Close
Set RS4 = Nothing
Rs5.Close
Set RS5 = Nothing
Rs6.Close
Set RS6 = Nothing
Conn.Close
Set conn=Nothing
%>
scusate ragazzi in teoria questo script dovrebbe fungere da motore di ricerca, effettuando una ricerca su più condizioni, ora una volta eseguito mi restituisce questo errore
Microsoft VBScript compilation error '800a040e'
'loop' without 'do'
/comunelaigueglia/ricercadelibere2.asp, line 879
loop
qualcuno sa darmi una mano ?
grazie in anticipo

Rispondi quotando
