 |
Server.CreateObject()是IIS3.0、IIS4.0时代的语法,在IIS6.0的服务里可以将代码更改为:
Set Conn = CreateObject("ADODB.Connection")
(去掉了Server.)
这样修改后就不会出现'c0000005'错误了。
naruil的意见:
检查是否在SESSION变量中储存了ADO记录集对象,微软对此的解释是
SYMPTOMS
When an ActiveX Data Objects (ADO) recordset is stored in a session variable that is in an Active Server Pages (ASP) application, you may get one of the following error messages:
Microsoft VBScript runtime (0x800A01FB)
An exception occurred: 'Session'
-or-
Active Server Pages, ASP 0241 (0x80004005)
The CreateObject of '(null)' caused exception C0000005.
-or-
Microsoft VBScript runtime (0x800A01FB)
An exception occurred: 'Open'
CAUSE
This problem occurs because the session variables in Internet Information Server (IIS) 5.0 are stored in the Global Interface Table (GIT), and this causes an access violation with an open recordset when it is stored in a session variable.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
This bug was corrected in Microsoft Data Access Components version 2.6 or later.
相关问题:
QA004930 "IIS程序:检查权限时Server.CreateObject 的调用失败"
此问题由周松回答。
附加关键字:编程, 源程序, programming, source code, 其他语言, asm, vba, vbscript, Internet编程, INET, www, internet, ie, 错误信息, error, error message, link, compile, runtime。
|