|
To create an OLE column:
- Specify the data source. The database table you select must have at least two columns (a key column and a column with the data type blob).
- Save the DataWindow and return to the DataWindow Painter workspace.
- Select OLE Database Blob from the Objects Menu and click the position at which you want to place the Blob in the DataWindow. The Database Binary/Large Text Object window lists the available database tables.
- Enter a name for the object in the Name box.
- Select the database table that contains the large database object you want to insert in the DataWindow. The names of the large binary or text columns in the selected table display in the Large Binary/Text Column list box.
- Select the column that contains the Blob data type by double-clicking the column name or entering the name in the box.
- Enter the key clause in the Key Clause box. The key clause can be any valid WHERE clause. For example:
key_col = :doc_id
The key clause is used to build the WHERE clause in the SELECT or UPDATE statement for the OLE column.
- Enter the name of the file you want to open in the OLE client application. For example, to specify a Word for Windows document, enter the name of a .doc file.
TIP: If the server application is not on the current path, enter the fully-qualified name.
- Enter the text or an expression that can be evaluated in the DataWindow (usually with a Key clause) in the Client Name Expression box. This expression will display in the server application to identify the file.
TIP: If you have more than one OLE column in your DataWindow, use an expression to make sure the name is unique. For example, you might enter this expression to identify a document (doc_id as the key column name): "Document: " + doc_id
- Click OK. PowerBuilder closes the Database Binary/Large Text Object window and displays the DataWindow workspace.
TIP: To make the blob column easy to see, place a rectangle on top of the Blob and then select Send To The Back on the Edit Menu.
|