Ti ho incollato tutta la pagina... magari qualche errore ci sta pure, non sono un esperto dell'asp, lo sto usando solamente perchè avevo fretta di creare un applicativo per fare un esempio per la mia tesi, che devo discutere LUNEDI!!!!!!!! CA##O!! :) Cmq, ripeto, l'altra pagina che accede in lettura non da problemi, e l'ho copiata da questa! l'unico dubbio che al momento ho è sul controllo delle date.... ma perchè allora prima funzionava???!?!?!?
Intanto ti ringrazio per l'aiuto, torno a tirare giu dal calendario qualche santo... pardon, a lavorare! :D
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Lista prenotazioni</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body text="#000000" link="#000000" vlink="#000000" alink="#000000">
<form action="prenotazioni.asp" method="post" name="frmSrcPrenot" target="_self">
<input type="hidden" name="qry" value="1">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Macerata, <%=formatdatetime(Date(),1)%> <%= formatdatetime(Time(),vbShortTime)%></font></p>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td ><font face="Verdana, Arial, Helvetica, sans-serif" size=2>Scegli la sala</font></td>
<td>
<select name="sala" size="1">
<option value="Sala Grande" selected>Sala Grande</option>
<option value="Sala Piccola">Sala Piccola</option>
</select>
</td>
<td>
<input type="submit" name="Submit" value="Cerca">
</td>
</tr>
</table>
</form>
<%
if (Request("qry") <> "") then
dim Sala
Sala = request.Form("sala") 'Variables catching
dim i,n,sql
Dim TDate,FDate
Dim Conn
Dim Rs
Dim filePath
FDate=Date()
TDate=FDate+30
sql= "SELECT * From Prenotazioni WHERE ((Prenotazioni.[Tipo Sala]) = ('"&Sala&"')) ORDER BY Prenotazioni.[Data scelta]"
filePath = Server.MapPath("prenotazioni.mdb") 'Map prenotazioni database to physical path
Set Conn = Server.CreateObject("ADODB.Connection") 'Create ADO Connection Component to connect
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath 'with sample database
Set RS = Server.CreateObject("ADODB.Recordset")
RS.ActiveConnection = Conn
RS.CursorType = 3 'adOpenStatic
RS.Open sql, Conn
n = Rs.RecordCount
if (n>0) then
response.Write"<br>"
response.write "<font face=""Verdana, Arial, Helvetica, sans-serif"" size=""2""><b>Trovate " & n & " prenotazioni per la "&Sala
response.write "<hr color=""#FFB87D""><br>"
'Legenda
response.write "<table border=0 cellpadding=2 cellspacing=1 bgcolor=""#0086A9"">"
response.write "<tr><td bgcolor=""#2EB77A""> </td><td bgcolor=""#FFFFFF""><font size=""2""><b>Disponibile</td></tr>"
response.write "<tr><td bgcolor=""#F9F071""> </td><td bgcolor=""#FFFFFF""><font size=""2""><b>Da confermare</td></tr>"
response.write "<tr><td bgcolor=""#FF6666""> </td><td bgcolor=""#FFFFFF""><font size=""2""><b>Non disponibile</td></tr>"
response.Write "</table><br>"
'Creazione della tabella calendario
response.write "<table border=0 cellpadding=2 cellspacing=1 bgcolor=""#0086A9"">"
response.write "<tr>"
response.write "<td bgcolor=""#005E76""><font color=""#DECBB3""size=""2""><b>Data</td>"
response.write "<td bgcolor=""#005E76""><font color=""#DECBB3""size=""2""><b>Associazione</td>"
response.write "<td bgcolor=""#005E76""><font color=""#DECBB3""size=""2""><b>Oggetto Riunione</td>"
response.write "</tr>"
do Until (Rs.EOF)
if (FDate = Rs("Data Scelta")) then 'Data Prenotata
if (Rs("Pagato") <> False ) then 'Data Confermata
response.write "<tr><td bgcolor=""#FF6666""><font size=""2"">"
response.write formatdatetime(Rs("Data Scelta"), 1) & "</td>"
response.Write "<td bgcolor=""#FFFFFF""><font size=""2"">" & Rs("Associazione") & "</td>"
response.write "<td bgcolor=""#FFFFFF""><font size=""2"">" & Rs("Oggetto Riunione") & "</td>"
response.write "</tr>"
Rs.MoveNext
FDate=FDate+1
else 'Da Confermare
response.write "<tr><td bgcolor=""#F9F071""><font size=""2"">"
response.write formatdatetime(Rs("Data Scelta"), 1) & "</td>"
response.Write "<td bgcolor=""#FFFFFF""><font size=""2"">" & Rs("Associazione") & "</td>"
response.write "<td bgcolor=""#FFFFFF""><font size=""2"">" & Rs("Oggetto Riunione") & "</td>"
response.write "</tr>"
Rs.MoveNext
FDate=FDate+1
end if
else 'Data disponibile
WDay = weekday(FDate)
If (WDay = 1) then 'Se è domenica è una data non disponibile
response.write "<tr><td bgcolor=""#FF6666""><font size=""2"">"
response.write formatdatetime(FDate, 1) & "</td>"
response.Write "<td bgcolor=""#FFFFFF""><font size=""2"">Chiuso</td>"
response.write "<td bgcolor=""#FFFFFF""><font size=""2""></td>"
response.write "</tr>"
FDate=FDate+1
else
response.write "<tr><td bgcolor=""#2EB77A""><font size=""2""><a href=""insert.asp?Sala="&(Sala)& "&Data="&(FDate)&""" target=""_self"">"
response.write formatdatetime((FDate), 1) & "</a></td>"
response.Write "<td bgcolor=""#FFFFFF""> </td>"
response.write "<td bgcolor=""#FFFFFF""> </td>"
response.write "</tr>"
FDate=FDate+1
end if
end if
loop
end if
Rs.Close
Conn.Close
'Date disponibili 'Questo ciclo supplementare è stato messo per
Do while (FDate <= TDate) 'elencare tutte quelle date disponibili entro un mese
WDay = weekday(FDate)
If (WDay = 1) then 'Se è domenica
response.write "<tr><td bgcolor=""#FF6666""><font size=""2"">"
response.write formatdatetime(FDate, 1) & "</td>"
response.Write "<td bgcolor=""#FFFFFF""><font size=""2"">Chiuso</td>"
response.write "<td bgcolor=""#FFFFFF""><font size=""2""></td>"
response.write "</tr>"
FDate=FDate+1
else
response.write "<tr><td bgcolor=""#2EB77A""><font size=""2""><a href=""insert.asp?Sala="&(Sala)&"&Data="&(FDate)&""" target=""_self"">"
response.write formatdatetime((FDate), 1) & "</a></td>"
response.Write "<td bgcolor=""#FFFFFF""> </td>"
response.write "<td bgcolor=""#FFFFFF""> </td>"
response.write "</tr>"
FDate=FDate+1
end if
Loop
response.write "</font></table>"
qry=""
end if
%>
<p><font color="#006699" face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="Body.asp" target="_self" >Torna
indietro</a></font> </p>
<p><br>
<br>
<br>
</p>
</body>
</html>