Inserting the WHERE Clause

Now that weve constructed the CursorAdapter filter WHERE clause, we are ready to add it to the CursorAdapter Select command. You can add the WHERE clause to the Select command by inserting it into the SelectCmd property of the CursorAdapter class.

To insert the WHERE clause into the CursorAdapter SelectCmd property

1.   Select the CursorAdapter on the Data Builder List page. Click the Designer button. VPME opens the VFP Class Designer for the CursorAdapter.

2.   Find the SelectCmd property on the Data tab of the Properties window and open it for editing.

3.   Add the WHERE clause to the end of the Select command displayed in the SelectCmd property edit window.

4.   Click OK to save your entry and to close the SelectCmd edit window.

5.   Close the Class Designer and save your changes.

The EMPLOYEES CursorAdapter is now filtered and wherever it is used in the application with functionality that requires the CursorAdapter filters, that functionality will now be automatically available.

Tip Using the CursorAdapter Builder: If you prefer, you can open the CursorAdapter Builder and insert the WHERE clause in the Select command box on the Data Access page. The Select command code entered on the Data Access page is stored in the SelectCmd property.



Modifying CursorAdapters