This example demonstrates the InternetTimeout property, which exists on the DataControl and DataSpace objects. This example uses the DataControl object and sets the timeout to 20 seconds.
'BeginInternetTimeoutVB
' to integrate this code
' replace the server name in the dc.server property
' and the DSN in the dc.connect property with no password for sa
Public Sub InternetTimeoutX()
Dim dc As RDS.DataControl
Dim rst As ADODB.Recordset
Set dc = New RDS.DataControl
dc.Server = "http://MyServer"
dc.ExecuteOptions = 1
dc.FetchOptions = 1
dc.Connect = "Provider=sqloledb;Data Source=MyServer;Initial Catalog=Pubs;User Id=sa;Password=;"
dc.SQL = "SELECT * FROM Authors"
' Wait at least 20 seconds
dc.InternetTimeout = 20000
dc.Refresh
' Use another Recordset as a convenience
Set rst = dc.Recordset
Do While Not rst.EOF
Debug.Print rst!au_fname & " " & rst!au_lname
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
End Sub
'EndInternetTimeoutVB
DataControl Object (RDS) | DataSpace Object (RDS) | InternetTimeout Property (RDS)
© 1998-2001 Microsoft Corporation. All rights reserved.