Using OLE Columns in A DataWindow Object
Using OLE Columns in A DataWindow Object
DataWindow object
You can create OLE columns in a DataWindow object. An OLE column
allows you to:
You can modify the document in the server, then update the data in
the DataWindow object. When the database is updated, the OLE column,
which contains the modified document, is stored in the database.
Database support for OLE columns If your database supports a blob
data type, then you can implement OLE columns in a DataWindow object.
The name of the data type that supports blob data varies. For
information on which data types your DBMS supports, see your DBMS
documentation.
3.
1. (Optional) Enter the client class in the Client Class box. The
default is DataWindow.
This value is used in some OLE server applications to build the
title that displays at the top of the server window.
2. (Optional) Enter the client name in the Client Name box. The
default is Untitled.
This value is used in some OLE server applications to build the
title that displays in the title bar of the server window.
3. In the Table box, select the database table that contains the
blob database column you want to place in the DataWindow
object.
The names of the columns in the selected table display in the
Large Binary/Text Columns listbox.
4. In the Large Binary/Text Columns box, select the column that
contains the blob data type from the list.
5. If necessary, change the default key clause in the Key Clause
box.
PowerBuilder uses the key clause to build the WHERE clause of
the SELECT statement used to retrieve and update the blob
column in the database. It can be any valid WHERE clause.
Use colon variables to specify DataWindow columns. For example,
if you enter this key clause:
id = :id
In the example, you would select Update from the File menu in
Microsoft Word. The OLE server application sends the updated
information to the DataWindow object.
7. Close the file in the server application (typically by
selecting Close from the File menu).
8. To save the blob data in the database, click the Save Changes
button in the PainterBar.
The new row, including the key value and the blob, are stored
in the database.
Later, after you retrieve the rows from the database, you can view
and edit the blob by double-clicking it, which invokes the OLE server
application and opens the stored document. If you make changes and
then update the database, all the modified OLE columns are stored in
the database.