|
COMMON PROBLEMS
No data returned; No HTTP headers; or
The specified CGI application misbehaved by not returning a
complete set of HTTP headers. The headers it did return are: (no
headers listed)
This is usually caused by one or more missing DLLs.
Without them, the server cannot even load the executable so it
gets flushed before it has a chance to write out anything, not
even an error message. This usually happens if the programmer is
running the Visual Basic editor on a different machine from the
web server. In this case, VB is not installed on the web server
machine. This can be fixed by installing VB. If this is not an
option, create a setup of your script by using the Setup Wizard
that comes with VB and install that on the web server machine.
This will install just the DLLs and other files needed to run the
script written in VB.
Server is not responding.
The most common cause is an untrapped error. For a
typical VB program, an error message pops up. When the user
clicks OK, the program gets terminated. As a web application, the
visitor does not get to see the message and there is no one at
the web server to click OK. Some web servers can tell that the
application is waiting for a user response so the server ends the
application. One solution is to fix the error as described in Debugging.
The ultimate solution is to trap all errors as described in Error
Trapping. Another cause of this problem is deliberately
popping up a message box or VB form. Such graphical user
interfaces have no place in a web application since visitors
cannot see them.
|
|
ERROR TRAPPING
An error trap in the Main procedure could be the most important
part of a VBWeb application. Leaving it out is the most common
mistake. In such a case, if an error occurs, the visitor never
gets a response. With a trap, at least the visitor gets to see a
generic error message. The error handler can be modified to
produce a more suitable message. Deeper traps can be set for more
specific handling. No error can slip by a trap in the Main
procedure. Such a trap might look like this example:
Public Sub Main()
On Error GoTo Trap
Call LoadRequest
Call ProcessRequest
Exit Sub
Trap:
Call ErrorHandler("")
Exit Sub
End Sub
|