【问题标题】:Why am I getting this VBScript "Overflow" error?为什么我会收到此 VBScript“溢出”错误?
【发布时间】:2010-10-29 19:18:25
【问题描述】:

我在这一行时不时收到“VBScript runtime error '800a0006': Overflow”:

Response.Cookies("AffiliateID").Expires = Date() + 30 '30 day cookie

错误消息引用了这一行,但它可能发生在它周围的代码中,如下所示:

 elseif Session("LoggedIn")<>1 and not isEmpty(request.querystring("aff")) then
    Dim arr_service_area_options, c
    arr_service_area_options = Split(Application("SERVICE_AREA_OPTIONS"),",")
    for c = 0 to UBound(arr_service_area_options)
        if CInt(Trim(request.querystring("aff"))) = CInt(Trim(arr_service_area_options(c))) then
            Session("AffiliateID") = arr_service_area_options(c)
            Response.Cookies("AffiliateID") = arr_service_area_options(c)
            Response.Cookies("AffiliateID").Expires = Date() + 30 '30 day cookie                    
            exit for
        end if
    next

【问题讨论】:

  • 检查附近是否有任何可能引发除以零错误的代码
  • "也许它发生在它周围的代码中?"除非您向我们展示它周围的代码,否则我们无法判断!您正在处理的请求中是否还存在 AffiliateID cookie?
  • 我从来没有弄清楚这一点,所以我重构了那个代码,因为无论如何它都很糟糕:)
  • 如果您运行的是 Windows Server 2003 x64 或 Windows XP x64,您可能会受到 C++ 运行时库中的故障的影响,并且可以从 Microsoft 下载修补程序。有关详细信息,请参阅 Microsoft KB955536 - VBScript throws a floating-point exception when the C runtime returns a stale floating-point status flag in a Windows Server 2003 environment

标签: asp-classic vbscript


【解决方案1】:

尝试将行更改为

Response.Cookies("AffiliateID").Expires = DateAdd("d", 30, Date()) '30 day cookie

【讨论】:

    猜你喜欢
    • 2019-01-09
    • 2018-06-22
    • 2016-01-01
    • 2019-04-13
    • 1970-01-01
    • 2012-02-19
    • 1970-01-01
    相关资源
    最近更新 更多