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 (FirstName, LastName, Title, and Email) are provided:

Sub Load

	SGrid.Caption = "Arcadia Bay Corporate Phone Directory"
	' SControl is an AdvancedDataControl object.
	SControl.SQL = "Select FirstName, LastName, " _
		& "Title, Email, Building, Room, Phone from Employee " _
		& "Where 2 < 1 for browse"
	SControl.Refresh

End Sub

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.