
True DBGrid also supports OLE DB data sources such as the ADO Data Control (ADODC). To end the program, press the End button on the Visual Basic toolbar. Refer to Run Time Interaction and try out the instructions for navigating, editing, and configuring the grid at run time. You have created a fully functional database browser without writing a single line of code! Note that the grid's current record stays in sync with the Data control. Click the navigation buttons on the Data control to move forward a record, back a record, to the last record, and to the first record. Any actions taken on the Data control will be reflected in the grid.

True DBGrid automatically communicates with the Data control. Note that the field names are used as the default column headings. True DBGrid retrieves the database schema information from the Data control and automatically configures itself to display all of the fields contained in the database table. Run the program and observe the following: Set the AllowAddNew and AllowDelete properties of TDBGrid1 to True (note that the default value of AllowUpdate is True). Set the DataSource property of TDBGrid1 to Data1. Set the DatabaseName property of Data1 to TDBGDemo.MDB, and the RecordSource property to Composer. Place a Data control (Data1) and a True DBGrid control (TDBGrid1) on the form (Form1) as shown in the following figure. Click OK to add the TDBGrid (and TDBDropDown) control icons to the toolbox. You will then be able to run the program and observe the run-time features of the grid.įrom the Visual Basic Project menu, select Components, then check the box labeled ComponentOne True DBGrid Pro 8.0. You will also learn about the basic properties associated with the Data control and True DBGrid.


In this tutorial, you will learn how to bind True DBGrid to a Visual Basic Data control and create a fully functional database browser without writing a single line of code. > Tutorial 1 - Binding True DBGrid to a Data Control Tutorial 1 - Binding True DBGrid to a Data Control
