Login  
Search All Forums
Dart Home | PowerTCP Web for ActiveX | Custom Development Reply | PowerTCP Web for ActiveX Topics | Forums   
AuthorForum: PowerTCP Web for ActiveX
Topic: Check For Errors?
computeronsite

From: Calgary, AB Canada
Posts: 45
Member Since: 06/12/02
posted August 25, 2006 7:17 PM

How do i check for errors using the web tool?
I want timeout to be 0 so it does not block my app

Data = ""'''public
Web.Abort
Web.Timeout = 0
Web.Url = WebUrl
Web.Get Data '''download the file

Private Sub Web_Error(ByVal Number As DartWebCtl.ErrorConstants, ByVal Description As String)
Debug.Print Description
End Sub

Private Sub Web_State()
List1.AddItem Web.State
Select Case Web.State

Case 0 ''''complete
 List1.AddItem Len(Data)
 Close #1
 Open "C:\Pic.jpg" For Binary As #1
 Put #1, , Data
 Close #1

Case 12 '''''error connecting
 Debug.Print "error"
End Select
End Sub

I want to be able to trap errors such as if the file its downloading isnt there or the website is not reachable.

However the Web_Error does not trigger nor does the state 12 (httpError)

I know that Data then becomes readable text and is saved as the .jpg
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 28, 2006 9:07 AM

Connection related errors would show up in the Error event.

Errors that occur after the HTTP connection has been established would be read via the 'Status' and 'StatusText' properties of the control when the State event fires with a state if httpCompleted.
Reply | PowerTCP Web for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX