VBScript Initialization Code

The VBScript section of the Address Book application first declares the variable myQuery. This variable will contain the SQL query that is dynamically built from text in the search fields, and sent to the database. Later, the Find_OnClick Sub procedure sets the value of this variable.

Dim myQuery

The remaining initializations are contained in the Load Sub procedure. These include adding a caption to the data grid. The WHERE clause is such that no records are pulled, so that only column headings are provided. Copy and paste this code within the <Script> </Script> tags.

Sub Load
	Grid1.Caption = "Arcadia Bay Corporate Phone Directory"

	' Initialize the data grid with column names only.
	SControl.SQL = "Select FirstName, LastName, Title, Email, " _
		& "Building, Room, Phone from Employee where 2 < 1"
	SControl.Refresh
End Sub