ComponentOne True DataControl 8.0
DataSource Page

The DataSource page defines the source of data for a TData control. For more information, see Data Access Modes. This page is unavailable in True DataControl Lite.

The DataMode combo box (upper-left corner) sets the DataMode property, one of the three modes in which a TData control can function. The DataMode property is supposed to be determined once in control’s lifetime, since changing it, although possible, has drastic effects.

The LockType combo box (lower-right corner) sets the LockType property, which determines the locking behavior of the control’s Recordset. Setting LockType to 1 – adLockReadOnly makes the TData Recordset read-only.

All other controls in the DataSource page are applicable only for data source mode (DataMode = 0 – Data Source). They are disabled in the memory array and the user events data modes.

The DataSource page design is modeled after the property pages of the standard ADO data control (Microsoft ADODC). This ensures smooth upgrade path for users familiar with ADODC. The difference is that three separate ADODC property pages: General, Authentication, and RecordSource, are combined in one True DataControl DataSource page for more convenience.

To define a data source in the DataSource page, start by specifying a Source of Connection. You can use one of three options: use a Data Link File, an ODBC Data Source Name, or enter the Connection String directly. These options are simply different ways of specifying the ConnectionString property. ConnectionString is the only property that is edited here. If you choose to enter the ConnectionString directly, you can use the Build button to open the Data Link Properties dialog. This is a standard dialog (the same is used in ADODC and other OLE DB/ADO data sources) allowing you to select an OLE DB provider, and specify its initialization properties that you need to establish connection with a data source.

The Other Attributes edit box allows you to add some custom text to ConnectionString that can’t be specified in the Data Link Properties dialog.

The Authentication group (UserName and Password) is also used to establish connection with a data source, if needed.

Once you have established the connection with the data source, you can specify a particular table, SQL query, or other command text that defines the RecordSource of the TData control. First, select the CommandType indicating how the RecordSource string must be interpreted. Then, depending on the CommandType, you can select a Table or Stored Procedure Name from the combo box list the TData control retrieves from the data source, or you can type directly in the Command text (SQL) text box.

Once you have specified the data source properties, press the Test button to test the data connection. If the connection source or RecordSource is not correctly specified, you will receive an error message indicating the reason for failure.

 

 


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

Product Support Forum  |  Documentation Feedback