OLEActivate

Description

Activates Object Linking and Embedding (OLE) for the specified object and sends the specified command verb to the OLE server application.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object


Syntax

PowerBuilder

integer dwcontrol.OLEActivate ( long row, integer column, integer verb )
integer dwcontrol.OLEActivate ( long row, string column, integer verb )

Argument

Description

dwcontrol

A reference to a DataWindow control or child DataWindow.

row

A long identifying the row location of the Database Blob control in the DataWindow object.

column

The column location of the Database Blob. Column can be a column number (integer) or a column name (string).

verb

Usually 0, but the verb is dependent on the OLE server.


Return value

Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is null, OLEActivate returns null.

Usage

The user can activate OLE by double-clicking an OLE blob column in a DataWindow. Use OLEActivate when you want to activate OLE in response to some other event or action -- for example, when the user clicks a button.

The verb you specify determines what action occurs when the OLE server application is invoked. The default verb (0) generally means you want to edit the document. Each OLE application has its own particular set of supported verbs. To find out what verbs the application supports, consult the documentation for the application, or look for the application name in the HKEY_LOCAL_MACHINE\SOFTWARE\Classes section of the Windows registry and find its Protocol\ StdFileEditing\Verb key. For example, the AVIFile class has three verbs, 0, 1, and 2, for Play, Edit, and Open.

Data for an OLE application is stored in the database as a Binary/Text Large Object (blob). In SQL Anywhere, the datatype of the database column is long binary. To make the blob accessible to users, use the DataWindow painter to set up the blob column. In the painter, you add an OLE Database Blob object (called TableBlob in the DataWindow object properties) to the DataWindow object and specify the OLE server application in the Database Binary/Text Large Object window.

For setup details, see Using OLE in an Application in Application Techniques.

Examples

This statement activates OLE for the Database Blob control in row 5 of the salary column in DataWindow dw_emp_data. The verb is 0:

dw_emp_data.OLEActivate(5, "salary", 0)

See also

Activate in the section called “Activate” in PowerScript Reference