此代碼正在工作,直到今天我不斷收到緩衝區超出錯誤。我很積極有更好的方式來做到這一點,但我不知道如何。ASP經典響應緩衝區可執行錯誤
我想要做的是顯示從當前日期到兩個星期的任何條目。用戶可以在兩週內輸入任何日期,表格將填入空格之間或之後的默認「綠色」範圍。我一直工作到今天。我在三週內沒有觸及它,我不知道發生了什麼事。我是一個低級圖形設計師,他的老闆們不知道html/css和asp/sql驅動的應用程序之間的區別。請幫我發瘋之前...
<div class="cond_holder">
<div class="dir_name">PEDS CARDIOLOGY</div>
<%
Dim this_day_peds_cardio
this_day_peds_cardio = Date
Dim Conditions_peds_cardio
Dim Conditions_peds_cardio_cmd
Dim Conditions_peds_cardio_numRows
Set Conditions_peds_cardio_cmd = Server.CreateObject ("ADODB.Command")
Conditions_peds_cardio_cmd.ActiveConnection = MM_webdbs_STRING
Conditions_peds_cardio_cmd.CommandText = "SELECT * FROM dbo.ryg_conditions WHERE aoc='1' AND Day >= DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0) ORDER BY aoc ASC, Day ASC"
Conditions_peds_cardio_cmd.Prepared = true
Set Conditions_peds_cardio = Conditions_peds_cardio_cmd.Execute
Conditions_peds_cardio_numRows = 0
Dim Repeat_peds_cardio__numRows
Dim Repeat_peds_cardio__index
Repeat_peds_cardio__numRows = 14
Repeat_peds_cardio__index = 0
Conditions_peds_cardio_numRows = Conditions_peds_cardio_numRows + Repeat_peds_cardio__numRows
While ((Repeat_peds_cardio__numRows <> 0) AND (NOT Conditions_peds_cardio.EOF))
If DateDiff("d", (Conditions_peds_cardio.Fields.Item("Day").Value), this_day_peds_cardio)=0 Then
%>
<span class="daily_condition <%=(Conditions_peds_cardio.Fields.Item("ryg").Value)%>">
<span style="display: none;"><%=(Conditions_peds_cardio.Fields.Item("aoc").Value)%></span>
<%=(Conditions_peds_cardio.Fields.Item("ryg").Value)%>
<span class="reason"><%=(Conditions_peds_cardio.Fields.Item("reasoning").Value)%></span>
</span><!-- /.daily_condtion -->
<%
this_day_peds_cardio = DateAdd("d", 1, this_day_peds_cardio)
Else
While DateDiff("d", (Conditions_peds_cardio.Fields.Item("Day").Value), this_day_peds_cardio)<>0
%>
<span class="daily_condition GREEN">GREEN</span><!-- SPACER -->
<%
this_day_peds_cardio = DateAdd("d", 1, this_day_peds_cardio)
Wend
%>
<span class="daily_condition <%=(Conditions_peds_cardio.Fields.Item("ryg").Value)%>">
<span style="display: none;"><%=(Conditions_peds_cardio.Fields.Item("aoc").Value)%></span>
<%=(Conditions_peds_cardio.Fields.Item("ryg").Value)%>
<span class="reason"><%=(Conditions_peds_cardio.Fields.Item("reasoning").Value)%></span>
</span><!-- /.daily_condtion -->
<%
this_day_peds_cardio = DateAdd("d", 1, this_day_peds_cardio)
End if
Repeat_peds_cardio__index=Repeat_peds_cardio__index+1
Repeat_peds_cardio__numRows=Repeat_peds_cardio__numRows-1
Conditions_peds_cardio.MoveNext()
Wend
While loop_ctr_peds_cardio < 14
%>
<span class="daily_condition GREEN">GREEN</span><!-- FILLER -->
<%
loop_ctr_peds_cardio = loop_ctr_peds_cardio +1
Wend
%>
</div><!-- /#cond_holder -->
感謝您在代碼格式上的輸入。我試圖找到格式化的最佳方式,但我仍然很新,這就是我被證明這麼做的方式。我們使用的是IIS6,我嘗試了Response.Buffer = False,但它打破了頁面,當它顯示時,發生超時,然後強制IE(是的,我只能使用IE)將退出。我要去嘗試Response.Flush,看看會發生什麼。再次感謝! – 2011-12-21 15:45:03