
March 3rd, 2003, 09:18 AM
|
|
Registered User
|
|
Join Date: Apr 2002
Location: Malta, Europe
Posts: 23
Time spent in forums: 4 m 15 sec
Reputation Power: 0
|
|
|
XMLHTTP timeout
Hello,
I am using the the function below to send a URL with arguments attached to it as query strings.
Public Function SendCommand(URLCommand) As String
Dim HttpReq As New MSXML2.XMLHTTP40
HttpReq.Open "GET", URLCommand, False
HttpReq.send
SendCommand = HttpReq.responseText
End Function
The function connects to an ASP page that returns a value which is read by my app using the "HttpReq.responseText" property.
It works fine most of the time, but occasionally, it freezes the system for up to 15 minutes. It looks like it cannot establish a connection with the ASP page. Is there a way to set up a timeout so that it gives up trying after say 10 seconds? Note that this function is called every 30 seconds using a Timer control to make sure an online and a local database contain the same information.
I am using VB 6 and XMLHTTP 4.
Thanks from beforehand!
|