Visualizzazione dei risultati da 1 a 7 su 7
  1. #1

    ADODB.Recordset error '800a0e7d'

    Salve a tutti,

    mi è comparso questo errore:

    ADODB.Recordset error '800a0e7d'

    The connection cannot be used to perform this operation. It is either closed or invalid in this context.

    /public/area_riservata/Blog/include/calendario.asp, line 91
    non riesco a capirne il perchè visto che è la prima volta che me lo indica...
    Mi potete aiutare? Grazie.

    Posto il codice interessato

    codice:
    <%
    Function NameFromMonth(iMonth)
    select case cint(iMonth)
    case 1
    s = "Gennaio"
    case 2
    s = "Febbraio"
    case 3
    s = "Marzo"
    case 4
    s = "Aprile"
    case 5
    s = "Maggio"
    case 6
    s = "Giugno"
    case 7
    s = "Luglio"
    case 8
    s = "Agosto"
    case 9 
    s = "Settembre"
    case 10
    s = "Ottobre"
    case 11
    s = "Novembre"
    case 12
    s = "Dicembre"
    end select
    NameFromMonth = s
    End Function
    
    Function LastDay(testYear, testMonth)
        LastDay = Day(DateSerial(testYear, testMonth + 1, 0))
    End Function
    
    
    Function GetPrevMonth(iThisMonth,iThisYear)
    GetPrevMonth=month(dateserial(iThisYear,iThisMonth,1)-1)
    End Function
    
    Function GetPrevMonthYear(iThisMonth,iThisYear)
    GetPrevMonthYear=Year(dateserial(iThisYear,iThisMonth,1)-1)
    End Function
    
    Function GetNextMonth(iThisMonth,iThisYear)
    GetNextMonth=month(dateserial(iThisYear,iThisMonth+1,1))
    End Function
    
    Function GetNextMonthYear(iThisMonth,iThisYear)
    GetNextMonthYear=year(dateserial(iThisYear,iThisMonth+1,1))
    End Function
    
    Sub DisplaysmallCalendar(sMonth, iYear)
            Response.write ("<table border='0' CELLPADDING=2 CELLSPACING=0 align='center' width='130'><tr><td height=""16"" align='right' width='33%'>")
    		Response.Write ("[img]../immagini/frecciasx.gif[/img][img]../immagini/frecciasx.gif[/img]</td><td align='center' width='34%'><font class='green'>")
    		Response.Write ( Ucase(sMonth) & "" & iYear & "</font></td><td width='33%'>" )
    		Response.Write ("[img]../immagini/freccia.gif[/img][img]../immagini/freccia.gif[/img]</td></tr></table>")
            Response.write ("<table border='0' CELLPADDING=2 CELLSPACING=0 align='center' width='130'><tr align='center'><td>L</td>")
            Response.write ("<td>M</td>")
            Response.write ("<td>M</td>")
            Response.write ("<td>G</td>")
            Response.write ("<td>V</td>")
            Response.write ("<td>S</td>")
            Response.write ("<td>D</td></tr>")
            Response.write ("<tr><td colspan=""7""><div class='hrgreen'>[img]../immagini/spacer.gif[/img]</div></td></tr>")
    
              i = 0
              dDay = DateSerial(iYear,iMonth,1)
              iMonth = Month(dDay)
              iYear = Year(dDay)
              iLastDay = LastDay(iYear, iMonth)
              iFirstDay=  Weekday(dDay)
              iLastDay = iFirstDay + iLastDay -1
    
              do while i<= iLastDay
    			if i <> iLastDay then
    			Response.Write ("<tr>")
    			else
    			exit do
    			end if
    			for j=1 to 7
    												
    				if (j < iFirstDay and i = 0) or (i + j > iLastDay)  then
    					 
    					Response.Write ("<td valign='top'></td>")
    				else
    					k =  k + 1
    					sDate = "#" & iMonth & "/" & k & "/" & iYear & "#"
    					Set rs_calendario = Server.CreateObject("ADODB.Recordset")
    					strSQL = "SELECT blog.* FROM blog WHERE data = " & sDate
                        rs_calendario.Open strSQL, adoCon
    					if rs_calendario.eof then
    					    if (k = Day(now)) and (iMonth = Month(now)) and (iYear = Year(now)) then
    						sEvent = "<div class='giornocorrente'>" &  k & " </div>"
    						else
    						sEvent =  k 
    						end if
    					else 
    					    if (k = Day(now)) and (iMonth = Month(now)) and (iYear = Year(now)) then
    						sEvent = "<div class='back'><A HREF = '../../../arc_blog.asp?giorno=" & k & "&month=" & iMonth & "&year=" & iYear & "' title='visualizza blog' target='_top'>" & k & "</A></div>"
    						else
    						sEvent = "<div class='back2'><A HREF = '../../../arc_blog.asp?giorno=" & k & "&month=" & iMonth & "&year=" & iYear & "' title='visualizza blog' target='_top'>" & k & "</A></div>"
    						end if
    					End If	
    					Response.Write ("<td valign='top' align='center'>")
    					Response.write sEvent
    					Response.Write ("</td>")
    				end if
    								
    			next
    			i=i+7
    			
              loop
              Response.Write ("</tr>")
    if rs_calendario.state <> 0 then rs_calendario.close
    
    set rs_calendario = nothing
    Response.Write ("</table>
    ")
    end sub
    %>
    Amor Vincit Omnia

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Facci capire prima tu... qual'è la riga 91?

    Roby

  3. #3
    Scusa hai ragione, riposto il codice evidenziando la riga incriminata

    codice:
    <%
    Function NameFromMonth(iMonth)
    select case cint(iMonth)
    case 1
    s = "Gennaio"
    case 2
    s = "Febbraio"
    case 3
    s = "Marzo"
    case 4
    s = "Aprile"
    case 5
    s = "Maggio"
    case 6
    s = "Giugno"
    case 7
    s = "Luglio"
    case 8
    s = "Agosto"
    case 9 
    s = "Settembre"
    case 10
    s = "Ottobre"
    case 11
    s = "Novembre"
    case 12
    s = "Dicembre"
    end select
    NameFromMonth = s
    End Function
    
    Function LastDay(testYear, testMonth)
        LastDay = Day(DateSerial(testYear, testMonth + 1, 0))
    End Function
    
    
    Function GetPrevMonth(iThisMonth,iThisYear)
    GetPrevMonth=month(dateserial(iThisYear,iThisMonth,1)-1)
    End Function
    
    Function GetPrevMonthYear(iThisMonth,iThisYear)
    GetPrevMonthYear=Year(dateserial(iThisYear,iThisMonth,1)-1)
    End Function
    
    Function GetNextMonth(iThisMonth,iThisYear)
    GetNextMonth=month(dateserial(iThisYear,iThisMonth+1,1))
    End Function
    
    Function GetNextMonthYear(iThisMonth,iThisYear)
    GetNextMonthYear=year(dateserial(iThisYear,iThisMonth+1,1))
    End Function
    
    Sub DisplaysmallCalendar(sMonth, iYear)
            Response.write ("<table border='0' CELLPADDING=2 CELLSPACING=0 align='center' width='130'><tr><td height=""16"" align='right' width='33%'>")
    		Response.Write ("[img]../immagini/frecciasx.gif[/img][img]../immagini/frecciasx.gif[/img]</td><td align='center' width='34%'><font class='green'>")
    		Response.Write ( Ucase(sMonth) & "" & iYear & "</font></td><td width='33%'>" )
    		Response.Write ("[img]../immagini/freccia.gif[/img][img]../immagini/freccia.gif[/img]</td></tr></table>")
            Response.write ("<table border='0' CELLPADDING=2 CELLSPACING=0 align='center' width='130'><tr align='center'><td>L</td>")
            Response.write ("<td>M</td>")
            Response.write ("<td>M</td>")
            Response.write ("<td>G</td>")
            Response.write ("<td>V</td>")
            Response.write ("<td>S</td>")
            Response.write ("<td>D</td></tr>")
            Response.write ("<tr><td colspan=""7""><div class='hrgreen'>[img]../immagini/spacer.gif[/img]</div></td></tr>")
    
              i = 0
              dDay = DateSerial(iYear,iMonth,1)
              iMonth = Month(dDay)
              iYear = Year(dDay)
              iLastDay = LastDay(iYear, iMonth)
              iFirstDay=  Weekday(dDay)
              iLastDay = iFirstDay + iLastDay -1
    
              do while i<= iLastDay
    			if i <> iLastDay then
    			Response.Write ("<tr>")
    			else
    			exit do
    			end if
    			for j=1 to 7
    												
    				if (j < iFirstDay and i = 0) or (i + j > iLastDay)  then
    					 
    					Response.Write ("<td valign='top'></td>")
    				else
    					k =  k + 1
    					sDate = "#" & iMonth & "/" & k & "/" & iYear & "#"
    					Set rs_calendario = Server.CreateObject("ADODB.Recordset")
    					strSQL = "SELECT blog.* FROM blog WHERE data = " & sDate
                                            rs_calendario.Open strSQL, adoCon
    					if rs_calendario.eof then
    					    if (k = Day(now)) and (iMonth = Month(now)) and (iYear = Year(now)) then
    						sEvent = "<div class='giornocorrente'>" &  k & " </div>"
    						else
    						sEvent =  k 
    						end if
    					else 
    					    if (k = Day(now)) and (iMonth = Month(now)) and (iYear = Year(now)) then
    						sEvent = "<div class='back'><A HREF = '../../../arc_blog.asp?giorno=" & k & "&month=" & iMonth & "&year=" & iYear & "' title='visualizza blog' target='_top'>" & k & "</A></div>"
    						else
    						sEvent = "<div class='back2'><A HREF = '../../../arc_blog.asp?giorno=" & k & "&month=" & iMonth & "&year=" & iYear & "' title='visualizza blog' target='_top'>" & k & "</A></div>"
    						end if
    					End If	
    					Response.Write ("<td valign='top' align='center'>")
    					Response.write sEvent
    					Response.Write ("</td>")
    				end if
    								
    			next
    			i=i+7
    			
              loop
              Response.Write ("</tr>")
    if rs_calendario.state <> 0 then rs_calendario.close
    
    set rs_calendario = nothing
    Response.Write ("</table>
    ")
    end sub
    %>
    Amor Vincit Omnia

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Se nella FOR / NEXT instanzi l'oggetto rs_calendario nellop stesso ciclo lo devi chiudere e distruggere.

    Roby

  5. #5
    Ok grazie ho capito e risolto!!!!
    Amor Vincit Omnia

  6. #6
    ----------------------------------------------------
    nello spirito del forum, spiega come hai fatto, così aiuterai qualche altro forumista che dovesse avere lo stesso problema.
    ----------------------------------------------------

  7. #7
    Ho preso spunto da quanto scritto da Roby_72

    Originariamente inviato da Roby_72
    Se nella FOR / NEXT instanzi l'oggetto rs_calendario nellop stesso ciclo lo devi chiudere e distruggere.

    Roby
    e ho posto l'attenzione sul verbo distruggere .
    In effetti il codice che ho postato non contiene nessun errore. L'errore stava nel fatto che includevo il codice incriminato DOPO aver distrutto le variabli di connessione strCon e strAdo.

    Mi è quindi bastato spostare in fondo alla pagina e tutto si è risolto.

    Spero di essere stato chiaro e di aiuto per qualcun'altro.

    Ciao Ciao
    Amor Vincit Omnia

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.