|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
XMLHTTP "hangs" system temporarily
I got a VB application that connects to a web database to check for changes once every 15 seconds using a Timer control. It also uploads changes done to the local database in the form of SQL commands attached to a URL as querystrings.
Here is a code sample: ----------------------------------------------------------------------------------- For x = 0 To rstQue.RecordCount - 1 Result = SendCommand("https://myhost/executor.asp?strSQL=" & URLEncode(rstQue!SQLCommand)) If Result = rstQue!SQLCommand Then '//Set "Uploaded" flag// rstQue.Edit rstQue!Uploaded = True rstQue.Update '\\\\\\\\\\\\\\\\\\\\\\\\\ End If rstQue.MoveNext DoEvents Next x Public Function SendCommand(URLCommand) As String Dim HttpReq As New MSXML2.XMLHTTP40 HttpReq.Open "GET", URLCommand, False HttpReq.send SendCommand = HttpReq.responseText End Function ----------------------------------------------------------------------------------- Executor.asp is a simple ASP page that executes the SQL commands fed to it through a querystring variable named "strSQL" and returns the SQL command back if the execution is successful. My problem is that during the execution of the XMLHTTP command, the system stops responding to keyboard and mouse input for a few seconds. Adding the "DoEvents" command in the for next loop has reduced the problem drastically but it is still disturbing since it is done once every 15 seconds. It looks like the XMLHTTP command takes control of all the system resourses while it is trying to connect to the web database. Is there a way to prevent this? I am using Windows XP and VB 6. Thank you. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > XMLHTTP "hangs" system temporarily |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|