|
The ADO Data control provides an easy way to access data, but you can accomplish more if you write a bit of code, as well. For example, you can execute SQL queries and display the results in a bound DataGrid control.
This lesson uses the bound DataGrid control you created in Lesson 2, with a few changes, to display the results of a SQL statement. At the end of this lesson, you will be able to enter a capacity into a text field and find the rooms that hold that capacity or greater. Such a form might be handy for a meeting planner.
To execute a SQL statement through ADO:

This creates a text entry box your user can use to provide input on the form.

Enter Capacity:. This provides an instruction for the user.
Now that the controls are in place, you can write the SQL statement that retrieves the records you want to see.




When you change the value in the text box, the Microsoft Jet engine parses the SQL statement and issues an ODBC request, which is passed to the Pervasive.SQL engine. Because the Microsoft Jet engine parses the SQL statement, your application's SQL statement must comply with Jet SQL syntax. For more information about this syntax, refer to the Visual Basic help.
|
Chapter contents
Prev topic: Lesson 2: Using the ADO Data Control (ADODC)
|