Database Exchange > Configuration > Setting up a data source

Setting up a data source

To connect the Database Exchange ActiveX Control to a database and view or edit data, you must first specify a data source. This information is set in the Connection tab of the ActiveX control's Properties dialog (accessible by double-clicking on the control).

The Connection tab includes the following fields:

Database Connection String

The details of the connection between the Database Exchange ActiveX control and the data source. This includes the location of the data source, driver and security information, and default data source settings. This string is built when you set up a data source, as described in the example below.

Record Source

The type of data source you are connecting to.

Note: The Database Exchange ActiveX Control does not support a connection to the local Citect runtime via the Citect OLE DB Provider.

Example

The following example illustrates how to create and configure a new data source in order to connect to the Recipes.DBF file in the CitectSCADA Example project.

  1. Double-click the Database Exchange ActiveX control and click the Connection tab on the right-hand side of the dialog.
  2. Click the Build button next to the Database Connection String field. This will launch the Data Link Properties utility.
  3. In the Provider tab, select Microsoft OLE DB Provider for ODBC Drivers and click Next.
  4. In the Connection tab, click the Use Connection String radio button and then click Build.
  5. In the Select Data Source dialog, click New to create a new DSN.
  6. Select Microsoft dBase Driver from the Create New Data Source dialog. Click Next and then Browse.
  7. In the Save As dialog, enter a name for the DSN in the File Name field and click Save.
  8. Click Next in the Create new Data Source dialog.
  9. Click Finish.
  10. In the ODBC dBASE Setup dialog, select dBase IV from the Version drop-down box and uncheck Use Current Directory.
  11. Click Select Directory and browse to your Citect Example folder (Citect\User\Example).
  12. Click OK until you are returned to the Connection tab of the Data Link Properties dialog.
  13. Click Test Connection. A message should display notifying you that the test succeeded.
  14. Click OK. You will be returned to the Connection tab in the Properties dialog. The connection string should now display in the Database Connection String field.
  15. Under Record Source, select the Unknown radio button and type Recipes in the text box. Click OK.
  16. On the graphics page, the Database Exchange ActiveX control should now display the data from Recipes.DBF.

For more information about setting up different types of data sources, see the following: