PowerBuilder DataWindow control

Features

The PowerBuilder DataWindow control is a container for DataWindow objects in a PowerBuilder application. You can use it in a window to present an interactive display of data. The user can view and change data and send changes to the database.

In addition to the DataWindow control, the DataStore object provides a nonvisual container for server applications and other situations where on-screen viewing is not necessary.

The DataWindow supports data retrieval with retrieval arguments and data update. You can use edit styles, display formats, and validation rules for consistent data entry and display. The DataWindow provides many methods for manipulating the DataWindow, including Modify for changing DataWindow object properties. You can share a result set between several DataWindow controls and you can synchronize data between a client and server.

Development environment

You can develop both parts of your DataWindow implementation in PowerBuilder. You use:

In the PowerBuilder Browser you can examine the properties, events, and methods of DataWindow controls and DataStore objects on the System tab page. If you have a library open that contains DataWindow objects, you can examine the internal properties of the DataWindow object on the Browser’s DataWindow tab page.

DataWindow objects

The DataWindow control or DataStore object uses a DataWindow object defined with any presentation style. The DataWindow object determines what data is retrieved and how it is displayed. The control can also display Powersoft reports (PSRs), which do not need to retrieve data.

Database connections

The PowerBuilder DataWindow can use ODBC, JDBC, and native database drivers for database connectivity. Users can connect to a data source on any server to which they have access, including databases and middle-tier servers on the Internet.

To make a connection, you can use the internal Transaction object of the DataWindow, or you can make the connection with a separate PowerBuilder transaction object.

A PowerBuilder application provides a default Transaction object, SQLCA. You can define additional Transaction objects if you need to make additional connections. When you connect with a separate Transaction object, you can control when SQL COMMIT and ROLLBACK statements occur, and you can use the same connection for multiple controls.

For more information about using a Transaction object with a DataWindow, see Chapter 2, “Using DataWindow Objects.”

For more information about PowerBuilder Transaction objects, see Application Techniques in the PowerBuilder documentation set.

Coding

You write scripts in the Window or User Object painter to connect to the database, retrieve data, process user input, and update data.

In PowerBuilder, you can take advantage of object inheritance by defining a user object inherited from a DataWindow control and adding your own custom functionality. You can reuse the customized DataWindow control throughout your applications.

You create DataStore objects, the nonvisual version of a DataWindow control, by creating them in a script and calling methods for the object. You can also define a user object that is inherited from a DataStore and customize it. For more information, see Chapter 4, “Using DataStore Objects.”

Libraries and applications

You store DataWindow objects in PowerBuilder libraries (PBLs) during development. When you build your application, you can include the DataWindow objects in the application executable or in PowerBuilder dynamic libraries (PBDs).

For more information about designing DataWindow objects and building a PowerBuilder application, see the PowerBuilder Users Guide and Application Techniques.