Vous êtes sur la page 1sur 3

DCO Sample Application

This application demonstrates the use of DCO ocx for Contact table for repository database.

DCO refers to the general Avaya’s database interface. It is a set of libraries (or a single DLL
on Windows/NT) that provide applications with a database independent interface to a
CustomerQ databases. Perhaps its most powerful component is the SQL generation that
enables an application to perform complex searches and insert, update and delete records
without having to construct any SQL.

The DCO requires an ADL (application definition language) file that describes the data model
and relationships between tables. Externally, Avaya provides classes for DBNetwork,
DBTable and DBRecord objects.

Sample application mainly provides following DCO classes.

1. DBTable - corresponds to a table (alias) for a table in the database
2. DBNetwork - a group of table aliases and relations
3. DBRecord - a record in either a Dco

The following steps should be done before accessing database.

1. DCO initialization
API - DCOInitializeOCX
This initializes DCO. And is the first API that needs to be called. It is the ignition key for DCO,
unless you turn it on, DCO won’t run.

2. Login to database
API – DCOVespLogin
Username: User name used to login into vesp as client
Passwd: user password.
This is to be used by clients which do not need Vesp access other then through DCO.
This log in the client into the vesp network. If client is logged into vesp then calls to
it will return success.

3. Database initialize
API – DCODbInitialize
AdcRecordName – adcRecordName to be used. This is retrieved from Directory
server. DCO client’s config from ICManager has this as one of the fields. In case you
want to read from file this has to have full path of that file.
AppName - application name to be used, to be used only if you want to read the adc
from file and not from Directory server.

4. Parse adl file from dbms

API – DCOAdlParseFileFromDbms
charcP - filename File name of the ADL files that needs to be parsed.
DCOAdlParseFileFromDbms compares the ADL file on the disk with that in the
database and if the file on the disk is older then one in the DB, then the one from DB
is retrieved on the disk. Then it goes and parses the file and builds all the required
information for the application name that is passed as the parameter.
5. cleanup of all resources
API – DCOCleanUp
This should be called while terminating application. It frees all resources allocated for
the instance of DCO.

How to create sample application:

1. Create a windows form application in VB.NET OR C# OR VB6.

2. Add DCO ocx in the project using Toolbox
3. Drag this added DCO object to main form window.
4. Add one user control in the project. Add Microsoft’s flex grid control and text
boxes on this user control to show records.
5. Flex grid will be used to show all found records and text boxes will display
selected record from Flex Grid.
6. On Main window form add tab control. This tab control will hold user control
which is added in step 4.
7. Add one standard windows login form to accept login credentials.
8. Add DBNetwork, DBTable and DBRecord classes in the project.
9. Add functionality for login and records to be show .(refer sample application)

Operations provided by Sample Application:

1. Search – To search a record with or without criteria. This will retrieved records
from database and add it into Microsoft’s Flex Grid control. To search any specific
record first clear all text boxes using “Clear” button and then enter a data to be
searched and click on “Search” button.

2. New – To create a new record. After click on “New” button all text boxes are
cleared .You have to enter a data for a new record. And after this click on
“Update” button to commit the changes to database. If you want to check
changes click on “Clear” and do search again using “Search” button.

3. Change – To update an existing record. Select a record which you want to

And after that click on “Update” button to commit the changes.

4. Delete – Select a record that is to be deleted from Flex Grid. And Click on
“Delete” button. This will ask for confirmation for deletion. If there is dependency
of current record on other tables then DCO will not allow you to delete record.

5. Update – “Update” has to be clicked for “New” and “Change” operation so that
changes can be committed to the database.

6. Clear – This is used to clear all text boxes so that before performing search
operation user can add valid data.
Interoperatabilty files (Applicable only for .Net application)

.Net Framework generates following files after compilation. These files must be
shipped with binary

- AxInterop.MSFlexGridLib.dll
- AxInterop.QwdcocxLib.dll
- Interop.MSFlexGridLib.dll
- Interop.QwdcocxLib.dll