BUG: CommandTimout Property Problem with Connection Object

Last reviewed: December 11, 1997
Article ID: Q175264
The information in this article applies to:
  • Microsoft Active Server Pages, versions 1.0, 1.0b

SYMPTOMS

The Connection object of the ActiveX Data Objects supports the CommandTimeout property. This property is documented to support a value of 0, which provides for an infinite timeout. This functionality is not available in ActiveX Data Objects 1.0.

RESOLUTION

The CommandTimeout property functions properly for all values other than 0. If you wish an infinite timeout, you will need to use this parameter in conjunction with the Command object instead. The following example demonstrates how to set the Command object's timeout:

   Set MyConn = Server.CreateObject("ADODB.Connection")
   MyConn.ConnectionTimeout = Session("MyConn_ConnectionTimeout")
   MyConn.CommandTimeout = Session("MyConn_CommandTimeout") ' *** THIS HAS
    *** NO EFFECT BECAUSE OF THE BUG ***
   MyConn.Open Session("MyConn_ConnectionString"),
    Session("MyConn_RuntimeUserName"), Session("MyConn_RuntimePassword")
   Set cmdTemp = Server.CreateObject("ADODB.Command")

   ' *** T H I S   L I N E   W A S   A D D E D ***
   cmdTemp.CommandTimeout = 0 ' *** SETTING IT TO ZERO CAUSES IT TO WAIT
    FOREVER ***

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following code attempts to set the timeout to 0. When set to this value, the connection object should provide for an indefinite amount of time before timing out. It does not.

   <%
   Set cn = Server.CreateObject("ADODB.Connection")
   cn.CommandTimeout = 0
   cn.Open "datasourcename", "userid", "password"
   cn.Execute("SQL statement that would cause a timeout")
   %>

REFERENCES

For the latest Knowledge Base artices and other support information on Visual InterDev and Active Server Pages, see the following page on the Microsoft Technical Support site:

   http://support.microsoft.com/support/vinterdev/



Keywords          : AXSFCompADO AXSFDataBase AXSFSQL
Technology        : kbInetDev
Version           : WINNT:1.0,1.0b
Platform          : winnt
Issue type        : kbbug


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.