在调用ActiveX对象时处理脚本超时 [英] Handling Script Timeout when invoking ActiveX Object

查看:94
本文介绍了在调用ActiveX对象时处理脚本超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,对于Windows XP Professional SP1上的IIS5.1,我可以

1)在IIS管理器下设置 - >任何特定的虚拟目录 - >

配置 - >选项 - >该脚本超出该

目录中的所有页面或

2 )在特定页面中,按照
http://www.microsoft.com/windows2000...p/vbob246s.htm

例如<%Server.ScriptTimeout = 1%>


且2中的值不能小于1

我在做什么ASP页面如下:


Dim objOrderClient

objOrderClient = CreateObject(" Order.Client")


objOrderClient.PlaceOrder(objOrder)

问题是objOrderClient.PlaceOrder可能会超时。

我想要的是ASP脚本给出的ActiveX对象(一个.NET类

库,我通过.NET / COM Interop调用)运行长达30秒,如果

,则ActiveX对象不会返回"在30秒内,然后处理

超时(例如重定向到错误页面或显示自定义

错误消息)。检查err.description确实*不*工作:


错误恢复下一次

''更多代码

Dim objOrderClient

objOrderClient = CreateObject(" Order.Client")

objOrderClient.PlaceOrder(objOrder)


如果错误.nu​​mber<> 0然后

%>

SOS SOS< br>

<%= err.Description%>

<%

结束如果


因为,显然脚本在PlaceOrder

正在执行!


我得到的是以下标准的Microsoft错误,对于生产网站而言,这是非常专业的b $ b不专业!


脚本超时


/Publications/testiorder.asp


脚本的最长时间超出了执行。您可以通过为属性指定新值来更改此限制

Server.ScriptTimeout或通过更改IIS管理中的值

工具。

I understand that with IIS5.1 on Windows XP Professional SP1, I can
1) Either set under IIS Manager-> Any specific Virtual Directory->
Configuration->Options->ASP Script timeout for all pages within that
directory OR
2) Within a specific page, set the timeout as per
http://www.microsoft.com/windows2000...p/vbob246s.htm
e.g. <% Server.ScriptTimeout = 1 %>

and that the value in 2 cannot be less than that of 1
What I am doing from an ASP page is as follows:

Dim objOrderClient
objOrderClient = CreateObject("Order.Client")

objOrderClient.PlaceOrder(objOrder)
The problem is that objOrderClient.PlaceOrder can potentially "time-out".
What I want is for the ASP Script to give the ActiveX Object (a .NET Class
library which I invoke via .NET/COM Interop) up to 30 seconds to run, and if
the ActiveX Object does not "return" within 30 seconds, then handle the
timeout according (e.g. redirect to an error page or to display a custom
error message). Checking err.description does *not* work:

On error resume next
'' Some more code
Dim objOrderClient
objOrderClient = CreateObject("Order.Client")

objOrderClient.PlaceOrder(objOrder)

If err.number<>0 then
%>
SOS SOS <br>
<%=err.Description%>
<%
end if

Because, obviously the script is timing out at the point when PlaceOrder is
executing!

What I get is the following standard Microsoft error, which is rather
unprofessional for a production website!

Script timed out

/Publications/testiorder.asp

The maximum amount of time for a script to execute was exceeded. You can
change this limit by specifying a new value for the property
Server.ScriptTimeout or by changing the value in the IIS administration
tools.

推荐答案

你好Patrick,


您可以查看以下文章,了解它是否可以解决

问题:


HOWTO:使用MTS陷阱错误''ASP 0113''脚本超时
http://support.microsoft.com/default...;EN -US; Q182036


Luke

Hello Patrick,

You may take a look at following article to see if it can resolve the
problem:

HOWTO: Use MTS to Trap Error ''ASP 0113'' Script Timed Out
http://support.microsoft.com/default...;EN-US;Q182036

Luke


谢谢,但这篇MSDN文章只是*部分*解决问题!


是的,当脚本在无限循环中超时时,如文章中的示例代码

,OnTransactionAbort EventHandler被解雇打印出

所需的输出。不幸的是,在显示EventHandler

的输出之前,已经显示标准的Microsoft错误,因为接下来是

,我怎么能阻止这个标准的Microsoft错误

显示!!

Active Server Pages错误''ASP 0113''


脚本超时


/timeout.asp


超出了脚本执行的最长时间。您可以通过为属性指定新值来更改此限制

Server.ScriptTimeout或通过更改IIS管理中的值

工具。

" [MSFT]" <卢****** @ online.microsoft.com>在消息中写道

news:gw ************** @ cpmsftngxa10.phx.gbl ...
Thanks, but this MSDN article only *partially* solve the problem!

Yes, when the script timed-out in the infinite loop as in the example code
from the article, the OnTransactionAbort EventHandler get fired to print out
the desired output. Unfortunately, before the output from the EventHandler
is displayed, the standard Microsoft error has already displayed, as
follows, how could I prevent this standard Microsoft error from being
displayed!!
Active Server Pages error ''ASP 0113''

Script timed out

/timeout.asp

The maximum amount of time for a script to execute was exceeded. You can
change this limit by specifying a new value for the property
Server.ScriptTimeout or by changing the value in the IIS administration
tools.
"[MSFT]" <lu******@online.microsoft.com> wrote in message
news:gw**************@cpmsftngxa10.phx.gbl...
Hello Patrick,

你可以看看下面的文章,看看它是否可以解决问题:

HOWTO:使用MTS陷阱错误''ASP 0113''脚本定时出
http://支持.microsoft.com / default ...; EN-US; Q182036

Luke
Hello Patrick,

You may take a look at following article to see if it can resolve the
problem:

HOWTO: Use MTS to Trap Error ''ASP 0113'' Script Timed Out
http://support.microsoft.com/default...;EN-US;Q182036

Luke



另外,我只能得到使用米老鼠的例子。 MSDN

示例。


在适当的情况下,我有一个ASP页面,它是
1)server.createobject(" ; adodb.connection")一个ADODB.connection

2)调用。在ADODB.connection上执行(mySQL)以获取记录集

3)通过Interop在.NET类库上创建一个CreateObject(使用regasm

/ tlb工具) )

4)在ActiveX对象上调用一个方法3

问题

1)当页面设置为以下

<%@ TRANSACTION = REQUIRES_NEW LANGUAGE =" VBScript" %>

<%@ TRANSACTION = REQUIRED LANGUAGE =" VBScript" %>


2)我收到错误

err.number = -2147168246

err.Description =新交易无法入伍在指定的交易中

协调员。

(页面加载后,导致上述错误,COM +承诺

交易统计增量为1 ,这是在WinXP上的IIS5.1上

专业版SP1)


3)页面运行时没有错误(页面超时时除外,<

3.1)页面没有设置交易属性或

3.2)交易属性设置为SUPPORTED或NOT_SUPPORTED


4)使用这个生产ASP页面,即使页面超时,OnTransactionAbort子程序也不会被烧掉!


SOS

" Patrick" < PA ** @ reply.newsgroup.msn.com>写在留言中

新闻:u2 ************** @ TK2MSFTNGP15.phx.gbl ...
Also, I can only get the example working with the "Mickey mouse" MSDN
Example.

In a proper scenario, I have an ASP Page, which
1) server.createobject("adodb.connection") an ADODB.connection
2) invokes. execute(mySQL) on the ADODB.connection to get a Record Set
3) Does a CreateObject on a .NET Class Library via Interop (using the regasm
/tlb tool)
4) Invoke a method on the ActiveX object of 3

Problems
1) When the page is set to either of the following
<%@ TRANSACTION=REQUIRES_NEW LANGUAGE="VBScript" %>
<%@ TRANSACTION=REQUIRED LANGUAGE="VBScript" %>

2) I get error
err.number= -2147168246
err.Description= New transaction cannot enlist in the specified transaction
coordinator.
( After the page loads, resulting in the above error, the COM+ Committed
Transaction statistics increments by 1, this is on IIS5.1 on WinXP
Professional SP1)

3) The page runs without error (with the exception when the page timeout, of
course) when
3.1) The page has no transaction attributes set or
3.2) Transaction attribute is set to SUPPORTED or NOT_SUPPORTED

4) With this production ASP page, the OnTransactionAbort sub-routine is not
fired off even when the page times-out!

SOS
"Patrick" <pa**@reply.newsgroup.msn.com> wrote in message
news:u2**************@TK2MSFTNGP15.phx.gbl...
谢谢,但是这个MSDN文章只*部分*解决问题!

是的,当脚本在无限循环中超时时,如文章中的示例代码
,OnTransactionAbort EventHandler被触发打印
输出所需的输出。不幸的是,在显示
EventHandler的输出之前,已经显示了标准的Microsoft错误,如下所示,我怎么能阻止显示这个标准的Microsoft错误!!
Active Server Pages错误''ASP 0113''

脚本超时

/timeout.asp

脚本的最长时间执行被超出。您可以通过为属性
Server.ScriptTimeout指定新值或通过更改IIS管理工具中的值来更改此限制。

" [ MSFT] QUOT; <卢****** @ online.microsoft.com>在消息中写道
新闻:gw ************** @ cpmsftngxa10.phx.gbl ...
Thanks, but this MSDN article only *partially* solve the problem!

Yes, when the script timed-out in the infinite loop as in the example code
from the article, the OnTransactionAbort EventHandler get fired to print out the desired output. Unfortunately, before the output from the EventHandler is displayed, the standard Microsoft error has already displayed, as
follows, how could I prevent this standard Microsoft error from being
displayed!!
Active Server Pages error ''ASP 0113''

Script timed out

/timeout.asp

The maximum amount of time for a script to execute was exceeded. You can
change this limit by specifying a new value for the property
Server.ScriptTimeout or by changing the value in the IIS administration
tools.
"[MSFT]" <lu******@online.microsoft.com> wrote in message
news:gw**************@cpmsftngxa10.phx.gbl...
Hello Patrick,

HOWTO:使用MTS捕获错误''ASP 0113''脚本超时 http://support.microsoft.com /default...;EN-US;Q182036

卢克
Hello Patrick,

You may take a look at following article to see if it can resolve the
problem:

HOWTO: Use MTS to Trap Error ''ASP 0113'' Script Timed Out
http://support.microsoft.com/default...;EN-US;Q182036

Luke




这篇关于在调用ActiveX对象时处理脚本超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆