ComponentOne Query 8.0
Tutorial 8 - Using C1Query Engine with Non-C1Query User Interface

In this tutorial we will make the ultimate customization of C1Query user interface: replace it completely with an interface built with standard Visual Basic controls, without C1QueryFrame. Still, the C1Query engine, the C1Query control can be used to generate SQL statements, although the user interface is built with other means.

  1. Open Tutorial 8 project (its default location is \Program Files\ComponentOne\Query 8.0\tutorials\Tutorial08). You see that C1QueryFrame1.Visible is set to False. We don’t use C1QueryFrame user interface, our UI is built with standard Visual Basic controls: list boxes, combo boxes and an edit box. We use a C1Query control in the project, with schema imported from the sample database, NWIND.MDB, as in Tutorial 2.

  2. Look at the FillQueryFrame procedure. It uses C1QueryFrame object model, the AddItem method and properties of the Item object to fill the C1QueryFrame1 control with condition items specified by the user in the Visual Basic UI controls. Once C1QueryFrame1 is filled with data representing the user query, we call C1Query1.BuildSQL to generate the SQL statement.

Run the Program and Observe the Following:

Add some conditions with the Add to query button and press Show SQL and/or Apply Query. You see how C1Query engine generates SQL statements based on the data supplied from other Visual Basic controls.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback