Inet control report no error even when data is lost 
Author Message
 Inet control report no error even when data is lost

I busy with an application using the Internet Transfer Control (6.0 SP4)
where I Post a file in pieces to a web server (ASP page) that reassembles
the file and save it on the web server. The files I transfer are relatively
large (2~5 MB)
The problem is that some "packets" are not received by the web server but
none of the Inet control properties gives any indication that an error
(timeout or whatever) occured.
I use a function to do the processing of each sub portion of the file
sending that should return an error and stop the whole process. However no
error is reported and thus the following calls just go on sometimes
successfull and some not.
This only happens when the code is run from a client pc over the network.
When run on the same pc as the web server no problems occur.
On the server the asp receives the requests and pass to a VB component in
COM+. I doubt it is a load problem on the ASP or COM+ side as they work ok
when called from the local machine.
The following is a sample bit of the code.

    sHeader = "Append:" & IIf(chkAppend.Value = 0, "false", "true") & vbCrLf
    sHeader = sHeader & "XMLDocument:" & sFilename

    lError = ProcessPaket(txtPostUrl.Text, sHeader, sContents, lPacketSize)
    sHeader = "Append:true" & vbCrLf
    sHeader = sHeader & "XMLDocument:" & sFilename
    bRunning = True
    While lError = 0 And sContents <> "" And bRunning
        lFilePos = lFilePos + lPacketSize
        lError = ProcessPaket(txtPostUrl.Text, sHeader, sContents,

Private Function ProcessPaket(sURL As String, sHeader As String, ByRef
sPacket As String, lPacketSize As Long) As Long
On Error Resume Next
    Dim sContents As String
    Dim sResult As String
    Dim vtData As Variant, bDone As Boolean
    sContents = Left(sPacket, (lPacketSize))
    sPacket = Mid(sPacket, (lPacketSize) + 1)

    While Inet1.StillExecuting 'make sure no call is active
On Error GoTo err_handler
    Inet1.Execute sURL, "POST", sContents, sHeader
    If Inet1.ResponseCode <> 0 Then GoTo err_handler ' never happens

    While Inet1.StillExecuting

    ProcessPaket = Inet1.ResponseCode 'Always returns 0 even it data was not
received by server.
    Exit Function
    If Inet1.ResponseCode = 0 Then
        ProcessPaket = Err.Number
        ProcessPaket = Inet1.ResponseCode
    End If
End Function

Does someone have an idea how to check for errors that do occur but not
reported by the Inet control?
I tried the Getchunk method but it always return as empty.



Mon, 08 Mar 2004 17:08:51 GMT  
 [ 1 post ] 

 Relevant Pages 

1. I am trying to update a record, i am not using data control

2. I am trying to update a record, i am not using data control

3. Help - I am getting an error using data control

4. I am getting duplicate records, I mean everything is duplicate even Access record number

5. Inet control and data access control

6. What am I missing in Data Report SHOW?

7. What am I missing in Data Report SHOW?

8. MSWinsock Control Data Loss with no error reported (0/1)

9. Data lost to port errors.

10. Inet using HTTPS reports error #12045: Client authorization not setup

11. Breaks on error even when error trapping set to break on unhandled

12. printing without crystal report or data report for non data base reports


Powered by phpBB® Forum Software