Asp出怪事了,搞了一天没解决! 高手来探讨一下吧! 部分asp程序不响应!
正在研究某系统,今天回家突然发现好几个页面一起坏了!!! 没动怎么会坏呢?
症状:XP专业版,调试asp学生管理程序。运行某些asp页面,一直处于执行不完的状态,IE显示为空白,状态栏上的进度条慢慢走。
内存中出现2个dllhost进程,必须杀掉独立的那个dllhost,再重启IIS一次,才可以执行某些正常页面,但这些“坏掉的页面”一运行又就不响应了。
检查了一天不明白,我都要气哭了。 htm可以执行,一些查询数据库记录的页面也能执行,但这几个“坏掉的页面”就是不响应,代码也不同难以调试。
下面是我研究的结果,更加想不通:某页一开始我就加上了Response.End,但是运行就不响应,非要把下面某段我加上了“if 1=2”的那一段程序全删除掉,页面才会正常执行完。
“if 1=2”不是可以跳过这段程序吗?为什么必须要删除整段才能执行呢?
这个asp昨天还好好的啊。
其它几个坏页面我还没检查,就这一个就搞了一天了,又不给错误提示,就是不响应。
---------------------
'第一段在此
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/StudentConn.asp" -->
<!--#include file="CheckLogin.asp"-->
<%
Response.End
%>
'第二段在此
<%
' *** Insert Record: construct a sql insert statement and execute it
If 1=2 Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),",")
Delim = MM_typeArray(0)
If (Delim = "none") Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none") Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none") Then EmptyVal = ""
If (FormVal = "") Then
FormVal = EmptyVal
Else
If (AltVal <> "") Then
FormVal = AltVal
ElseIf (Delim = "'") Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''") & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End if
MM_tableValues = MM_tableValues & MM_columns(i)
MM_dbValues = MM_dbValues & FormVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' 在DW代码的基础上用SQL语句实现向数据库中添加表
strSubject="(StudentNum TEXT (8) CONSTRAINT MyFieldConstraint PRIMARY KEY,总分 SINGLE,平均分 SINGLE,全级排名 LONG,班级排名 LONG,"
strTemp=request("chkbox")
if instr(strTemp,",")>0 then
strSubject=strSubject & replace(strTemp,","," SINGLE,") & " SINGLE)"
else
strSubject=strSubject & strTemp & " SINGLE)"
end if
strSheetName = MM_dupKeyUserNameValue
MM_CreateTableConnection = MM_StudentConn_STRING
MM_CreateTableQuery = "Create Table " & strSheetName & strSubject
Set MM_CreateTableCmd = Server.CreateObject("ADODB.Command")
MM_CreateTableCmd.ActiveConnection = MM_CreateTableConnection
MM_CreateTableCmd.CommandText = MM_CreateTableQuery
MM_CreateTableCmd.Execute
MM_CreateTableCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>