Database Exchange > Tips and Hints

Tips and Hints

The Database Exchange control is developed in VB6 and is a single thread application. CitectSCADA as an ActiveX container will treat ActiveX controls as foreground objects. Thus a long running method of ActiveX control will hinder on the CitectSCADA main thread. For this reason, it is not recommended that an ActiveX control be running on CitectSCADA I/O Servers or critical CitectSCADA boxes, such as trend servers. For example, if you had a control on a CitectSCADA trend server that has a long running method, you might experience missing trend samples.

When you use Database Exchange control with CitectSCADA :

  1. Use select statement or parameters of a query or stored procedure to limit the size of returned data.
  2. Hide the graphics page that contains the control rather than close the page. This will avoid frequent opening and closing a connection to the data source.
  3. Use Graphics Builder to configure the control to avoid overhead property settings at runtime.

Currently the filter functionality of the Database Exchange control is not exposed as a public method or property. However, using a different SQL statement at runtime achieves the same result: take variable.dbf in the CitectSCADA Example project as an example. Assume the Database Exchange control occupies AN35.

  1. Insert a Database Exchange control on a graphics page.
  2. Configure the control using the Example project as a data source and variable.dbf as a record source.
  3. Add a memory string tag called SQLText.
  4. Display this string tag on the page and allow it to be changed at runtime.
  5. Add a button to the page and enter UpdateRecordSource(“AN35”,SQLText) in the Touch Command text box.
  6. At runtime, assign the following select statements to tag SQLText and then click the button:

SELECT * FROM Variable WHERE Name LIKE ‘%LOOP%’

Display all tags whose names start with “LOOP”.

SELECT * FROM Variable WHERE Name LIKE ‘%BIT%’

Display all tags whose names start with “BIT”.

FUNCTION UpdateRecordSource(STRING sAN,STRING sRecordSource)

     _ObjectSetProperty(ObjectByName(sAN), "RecordSource1",sRecordSource);

     _OBJECTCallMethod(ObjectByName(sAN), "Refresh");

END

In version 3.1.1 or later of Database Exchange control, the version number is displayed on the General tab on the properties form.