SetConnect

How it works

Database Functionality
Description

Integration Tool has a number of powerful plugins for database-functionality. This section describes the workings of these database plugins.

Database Internal Variables
<RS:READ:handle:column:recnum>
Reads a column from the specified record (specified by "recnum") of the recordset specified by "handle". "column" is the name of the column or the index of the column (first column is 0). If "recnum" is set to 0 then the current record will be used.
<RS:RECORD:handle:separator>
Reads the complete current-record from the recordset specified by "handle" and puts "separator" as a separator character between the columns.
<RS:RECORD:handle:HTML>
Reads the complete current-record from the recordset specified by "handle" puts it in a HTML row
<RS:ALL:handle:separator>
Returns all records which are in recordset "handle" and puts "separator" between the columns.
<RS:ALL:handle:HTML>
Returns all records which are in recordset "handle" and puts them in a HTML table.
<RS:LIST:handle:column:separator>
Returns the contents of the specified column from all records in the recordset and puts "separator" between the data of each row.
<RS:COUNT:handle>
Returns the number-of-records in the recordset specified by "handle".
<DatabaseErrors>
Contains the last database-related error.
Theory of operation

All opened databases and recordsets are referenced by a so called "handle"; when you open a database you specify the handle, which is a string by which you can later reference the database and it's recordset (which contains the actual data).

This means a handle is both a reference to an open database and to the recordset which is linked to the database and contains the result of the query. The "CloseHandle" command will close the database referenced by "handle" as well as the associated recordset.

Example:
Use the OpenDatabase command to open an MS-Access database and specify handle "DBTEST". When the Daemon executes the "OpenDatabase" command it will open the specified database and create an empty recordset. As long as the database is open, you can now reference the database and the recordset by the handle "DBTEST".
To query the database use the "QueryDatabase" command and specify handle "DBTEST". When the "QueryDatabase" command is executed, the handle "DBTEST" will be used to execute the query on the referenced database and the query-result will be put in a recordset which is also reference by handle "DBTEST".
NOTE: Running queries which don't return any data will leave the recordset empty.

There are now several ways you can retrieve and use the result of the query; you can use the "rsOuput2...." commands to output the complete recordset to a text file, excel file, word file or to another (or the same) database. Or you can use the internal variables to reference individual records or columns of the current record of the recordset. You can use the "rsMove..." commands to move the pointer in the recordset.

Apart from the database plugins, other plugins can also make use of "handles" to store data in a recordset. The "ReadEventLog" plugin for example stores it's data in a recordset. In that case the handle only references a recordset and not an open database.

Internal Database

The internal-database is a special database which is used by Integration Tool to store data for certain functions like the "Presets". The internal-database can be referenced by handle "INTERNAL". This means handle "INTERNAL" is a system-handle and can not be used to open other databases.

Closing Handles

The internal-database is automatically opened when an Integration Tool Daemon is started and will remain open unless the command "CloseHandle [close-all-handles]" is executed. If the internal-database is closed, you can open it again using the "OpenDatabase" command and just specify the handle "INTERNAL".

When another database is opened, it will remain open until a "CloseHandle [handle]" command is executed or when the Daemon stops.

Documentation

Release notes