ComponentOne List 8.0 for ActiveX
Tutorial 1 - Binding True DBList to a Data Control

In this tutorial, you will learn how to bind a True DBList control to a Visual Basic Data control and create a fully functional database browser.  You will also learn about the basic properties associated with the Data control and True DBList.  You will then be able to run the program and observe the run-time features of the list.

  1. Start a new project.

  2. From the Visual Basic Project menu, select Components, then check the box labeled ComponentOne True DBList 8.0. Click OK to add the TDBList (and TDBCombo) control icons to the toolbox. The TDBList icon looks like this:

  3. Place a Data control (Data1) and a True DBList control (TDBList1) on the form (Form1) as shown in the following figure.

  4. Set the DatabaseName (Data control) property of Data1 to TDBLDemo.mdb, and the RecordSource (Data control) property to Composer. 

  5. Set the RowSource property of TDBList1 to Data1.

Run the program and observe the following:

Refer to Run Time Interaction and try out the instructions for navigating and configuring the list at run time.

To end the program, press the End button on the Visual Basic toolbar.

OLE DB support:

True DBList also supports OLE DB data sources such as the ADO Data Control (ADODC). The following steps demonstrate how to create a simple database browser using the ADO Data Control.

  1. Start a new project.

  2. From the Visual Basic Project menu, select Components, then check the boxes labeled ComponentOne True DBList 8.0 (OLEDB) and Microsoft ADO Data Control 6.0 (OLEDB). Click OK to add the selected control icons to the toolbox. The TDBList icon looks like this:

  3. Place an ADO Data control (Adodc1) and a True DBList control (TDBList1) on the form (Form1) as shown in the following figure.

  4. Display the custom property pages for Adodc1. Click the General tab and select the Use Connection String option. Click Build. The "Microsoft OLE DB Provider for ODBC Drivers" option should be highlighted. Click Next>>. Enter the datasource name (C:PROGRAM FILES\TDBL7\TUTORIALS\TDBLDEMO.MDB) in the Use Data source name text box. You do not have to enter a user name or password. Test the connection to make sure it works. Close the dialog window.
    Click the OK button to close the property page.

  5. Set the CommandType (Data control) property to 2 - adCmdTable.

  6. Set the RecordSource (Data control) property to Composer.

  7. Set the RowSource property of TDBList1 to Adodc1.

  8. Congratulations, you have successfully completed Tutorial 1!

 

 


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

Product Support Forum  |  Documentation Feedback