Classic ASP : C0000005 Error on execution

前端 未结 10 862
旧巷少年郎
旧巷少年郎 2020-12-03 22:00

I\'m trying to execute classic ASP pages on a windows 2008 64 bit R2 box.

Initially the problem was with registering dlls : That\'s now fixed. Register DLL file on W

10条回答
  •  误落风尘
    2020-12-03 22:51

    I had the same problem happen sometime after KB4093114 was installed on a server. (I'm not 100% sure that the KB caused the problem but I suspect so because the scripting engine was updated.)

    The problem was caused by a recordset that output a varchar(max) field to the markup. Even though the error does not provide a line number, I was able to pinpoint it to the outputting of the varchar(max) field through trial and error.

    <%
    ...
    rs.Open "SELECT LongDescription FROM Table1"
    while (not rs.EOF)
       %> 

    <%= rs("LongDescription") %>

    <% ' ERROR HAPPENS BECAUSE OF THIS LINE rs.MoveNext wend %>

    Removing that line fixes the problem. Also, casting the field to a non-max varchar also fixes it:

     rs.Open "SELECT LongDescription = Cast(LongDescription as varchar(4000)) FROM Table1"
    

    To make matters worse, I found that once the error happens, even if you fix it you need to recycle the app pool to make the error go away.

提交回复
热议问题