WebSite Professional Server Self Test

Visual Basic 5.0 Sources

Robert B. Denny (15-Sep-97)

Overview of Visual Basic 5.0 Sources

The sample application uses the CGI32.BAS module that ships with WebSite, and which provides all of the interface code needed to get the CGI environment set up in VB globals. This module contains the Sub Main procedure. When Sub Main is finished with the CGI interface tasks, it calls the application via Sub CGI_Main, which is in the separate VB module that contains the code for the sample application. The application returns to Sub Main when it is finished.

CGI32.BAS also contains a global exception handler that will catch all VB runtime exceptions, including user-defined errors. If an exception occurs, the exception handler in CGI32.BAS rewinds the output file and inserts a fully formatted HTTP 500 Server Error response. Within the body of this response, the exception handler puts the textual VB runtime error message. The server then (transparently) returns this HTTP error message to the browser, allowing the user to see exactly what happened.

Finally, note that WebSite fully decodes all form fields before starting the Windows CGI program.

Module and Procedure Index

WebSite Tech Support