FIX: RDS Query Times Out After Five Minutes

ID: Q192718


The information in this article applies to:
  • Remote Data Service for ADO version 1.5


SYMPTOMS

Remote Data Service (RDS) version 1.5 times out when trying to run queries longer than five minutes. Clients receive the following error message:

Internet Client Error : Request Timeout.


CAUSE

The Wininet.dll has a default timeout of five minutes. RDS 1.5 used this .dll file and its default timeout.


RESOLUTION

This limitation is fixed in RDS 2.0 and later. You may download the latest version of Microsoft Data Access Components, including RDS, from the following Web address:

http://www.microsoft.com/data/download.htm
Note that RDS 1.5 is no longer available for download.

The RDS.Dataspace and RDS.Datacontrol in release 2.0 and later have a new property Called InternetTimeout, which takes the following range of values:
  • Minimum value of -2,147,483,648 (Times out immediately, any negative times out immediately.)


  • Maximum value of 2,147,483,647 (596 hours or 24 days, never times out.)


  • Value of 0 (will not timeout.)


  • Negative value (will timeout immediately.)



STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

This bug was corrected in RDS 2.0 and later.


MORE INFORMATION

Steps to Reproduce Behavior

To reproduce the problem create a Visual Basic ActiveX .dll that is installed on the server and runs under RDS from a Visual Basic client application.

This example has a method called WaitForAllotedtime, which takes an input parameter amounting to the delay that you need to create a long running query.

Creating the ActiveX DLL

  1. Start a new project in Visual Basic and select "ActiveX DLL". Class1 is created by default.


  2. From the Project menu, select Project1 Properties. Change the Project name to RDSTimeOutTestObj and the Project Description to RDS Time Out Test Object. Click OK to close the Project Properties dialog box.


  3. Select Class1 in your Project Window and press F4 to view the Properties. Change the Instancing property of Class1 to "5 MultiUse".


  4. Paste the following code into the General Declarations section of Class1:


  5. 
    Option Explicit
    Const SUCCESS = 999
    Public Function WaitForAllotedtime(ByVal WaitTime As Integer) As _
    Integer
      Pause (WaitTime) 'Introduce a delay simulating a long running query
      WaitForAllotedtime = SUCCESS
    End Function
    
    Sub Pause(ByVal nSecond As Single)
      Dim t0 As Single
      t0 = Timer
      Do While Timer - t0 < nSecond ' This loop introduces the delay of
      Dim dummy As Integer          ' nSecond using the Timer function.
      dummy = DoEvents()
      If Timer < t0 Then
       t0 = t0 - CLng(24) * CLng(60) * CLng(60)
      End If
      Loop
     End Sub 
  6. Save the project.


  7. From the File menu, click "Make RDSTimeOutTestObj.dll". You are now finished creating your ActiveX .dll project.


Creating the Visual Basic Test Client

  1. Test the ActiveX .dll project by creating another Visual Basic Standard .exe project as a client.


  2. From the File menu, click New Project, and then select Standard .exe project. Form1 is created by default.


  3. From the Project menu, select references and add a reference to the Microsoft Remote Data Services 2.0 Library.


  4. Place a Command button, named Command1, on Form1.


  5. Paste the following code into the General Declarations section of Form1:


  6. 
    Private Sub Command1_Click()
     Dim rs As New RDS.DataSpace
     Dim obj As Object
     Dim i As Integer
     rs.InternetTimeout = 305000   ' This is in milliseconds.
     Set obj = rs.CreateObject("RDSTimeOutTestObj.Class1", _
        "http://<your server name>")
     i = obj.WaitForAllotedTime(301)'301 seconds, cross the 5 min barrier
     MsgBox i   ' Should get 999 indicating success.
    End Sub 
NOTE: <your server name> is the name of your Internet Information Server (IIS) server, which hosts the business object.

Registering the ActiveX .dll to Run on RDS

  1. If you are not developing on your IIS server, you need to manually copy over the .dll to the IIS server and manually register it using Regsvr32.exe. Also check to make sure the RDSTimeOutTestObj business object is correctly registered on your IIS/RDS server. To see if the component is correctly registered, look in the registry by running "regedit" from the Run menu. The components are under the HKEY_CLASSES_ROOT key in alphabetical order.


  2. Make sure your createable object has launch rights on your server. This can be done by taking the following lines and saving them in a file with a .reg extension and double-clicking the file to merge the information into the registry. You can also do this manually with Regedit.exe:


  3. 
    REGEDIT4
       ;This entry should be on one line
       [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC
        \Parameters\ADCLaunch\RDSTimeOutTestObj.Class1] 

Testing the Application

  1. Run the Visual Basic client.


  2. Click the Command1 button.


  3. You should see a message box that displays 999, which indicates that the long running query has executed successfully without creating the following error:


  4. Internet Client Error : Request Timeout.
  5. To check whether the InternetTimeOut setting works you can set the InternetTimeOut value to something less than 301000 millisecond to get the error.



REFERENCES

For additional information, please see the following articles in the Microsoft Knowledge Base:

Q166277 HOWTO: Create a VB Component that Returns a Recordset in RDS
For more information, please see the following World Wide Web URL:

http://www.microsoft.com/data/ado/rds/
For additional information, please see the following public newsgroup:

   microsoft.public.ado.rds 
Remote Data Services version 1.5 Readme.txt

Data Access Software Development Kit (SDK) version 2.0 DASDKReadme.txt

ActiveX Data Objects version 2.0 ADOReadme.txt

Remote Data Services version 1.5 Help in the MSDN Library

Data Access Software Development Kit (SDK) Help

Additional query words:

Keywords : kbDatabase kbRDS kbRDS150 kbRDS150bug kbRDS200fix kbVBp kbGrpVBDB kbGrpMDAC kbDSupport kbRDS210SP2
Version : WINDOWS:1.5
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: November 11, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.