Transports and Interfaces: Siebel Enterprise Application Integration > Using Siebel OLE DB Provider > How Scripts and Custom Applications Affect Your Data >

Writing an OLE DB Consumer


You can write your own OLE DB consumer or access Siebel OLE DB Provider programmatically using standard programming languages, such as C++ and Visual Basic, or using scripting languages, such as VBScript and JavaScript.

This section describes the objects and object interfaces provided by OLE DB to facilitate access to Siebel OLE DB Provider and other OLE DB providers. This is a brief summary of the OLE DB interfaces. It is intended to identify the support available from the Siebel OLE DB Provider. You can find more information on the OLE DB interfaces from reference documentation published by Microsoft and others.

OLE DB Object Support in Siebel OLE DB Provider

The following list summarizes the OLE DB version 2.1 objects that are supported by the current version of Siebel OLE DB Provider:

  • DataSource
  • Session
  • Command
  • Rowset
About Siebel OLE DB DataSource Object

You can use any OLE DB-compliant products to access Siebel objects. These products include Microsoft Excel, Microsoft Access, and others. These applications are referred to as consumers. You must create the DataSource object by defining the object in an OLE DB consumer. During the creation process, you provide the properties and parameters required for the DataSource object to connect to the Siebel environment. The consumer then uses the DataSource object to create one or more Session objects.

The following DataSource object OLE DB interfaces are supported in the current version of Siebel OLE DB Provider:

  • IDBCreateSession
  • IDBInitialize
  • IDBProperties
  • IPersist
  • ISupportErrorInfo

You must specify DataSource properties to successfully initialize and authorize the connection to the Siebel environment, as shown in Table 22.

Table 22. OLE DB DataSource Properties
Property ID
Description

DBPROP_AUTH_USERID

A Siebel user name.

DBPROP_AUTH_PASSWORD

The password assigned to the Siebel user.

DBPROP_INIT_DATASOURCE

The connect string or the path to the local configuration file.

DBPROP_INIT_PROMPT

Default is DBPROMPT_NOPROMPT. Specifies the prompt mode supported for data source initialization. This provider supports every prompting mode.

About Siebel OLE DB Session Object

The DataSource object creates and uses the Session object to create one or more Rowset objects. The following Session object OLE DB interfaces are supported in the current version of Siebel OLE DB Provider:

  • IDBCreateCommand
  • IGetDataSource
  • IOpenRowset
  • ISessionProperties
  • IDBSchemaRowset
  • ISupportErrorInfo
About Siebel OLE DB Command Object

The OLE DB Command object supports and provides a subset of SQL commands that you can use to query the Siebel business objects supported by Siebel OLE DB Provider. The OLE DB consumer creates the Command object by executing IDBCreateCommand:CreateCommand. Multiple commands can be created and executed during a single session. Siebel OLE DB Provider supports the following OLE DB interfaces on the Command object:

  • IAccessor
  • ICommand
  • ICommandWithParameters
  • ICommandProperties
  • ICommandText
  • IColumnsInfo
  • IConvertType
  • ISupportErrorInfo
About Siebel OLE DB Provider Command Syntax

Siebel OLE DB Provider Command object supports a subset of SQL, which allows OLE DB consumers to issue simple query statements against one virtual table.

The following query is an example of the type of statement you can execute:

SELECT 'First Name', 'Last Name'
FROM Contact
WHERE 'Job Title' = Manager;

The general syntax of Siebel OLE DB Provider Command language is as follows:

  • Required terms are delimited by square brackets ([ ]).
  • Optional terms are delimited by angle brackets (< >).

    SELECT [ column/list of columns/* ]
    FROM [ table_name ]
    <WHERE> [ column = value ] <AND> [ column=value ]
    <ORDER BY> [ column ];

NOTE:  The current Command language does not support the JOIN construct. A command can be issued against only one virtual table.

About Siebel OLE DB Rowset Object

The Session object creates the Rowset. The consumer can also call ICommand:Execute to create a Rowset. The data in the Rowset object is displayed in tabular format. The following Rowset object OLE DB interfaces are supported in the current version of Siebel OLE DB Provider:

  • IAccessor
  • IColumnsInfo
  • IConvertType
  • IRowset
  • IRowsetInfo
  • ISupportErrorInfo
Transports and Interfaces: Siebel Enterprise Application Integration