Copying a DataWindow object into a library

The next DataWindow object you create will include the State column in the Customer table. This column uses a pre-defined DropDownDataWindow edit style called StateCode. A DropDownDataWindow edit style allows you to use another DataWindow object as the data source for a column. In this case, the DataWindow object has a list of states and their two-letter postal codes.

StateCode is an extended attribute associated with the State column in the EAS Demo database. Extended attributes are stored in system tables in the database and supply information about display formats, validation rules, edit styles, and fonts.

For more information about edit styles and extended attributes, see the DataWindow Designer User’s Guide.

You can see the definition of StateCode in the Database painter.

StepsTo view an edit style in the Database painter:

  1. Select View>Database Painter from the menu bar.

  2. In the Objects view, expand ODB ODBC>EAS Demo DB V110 DWD> Tables>customer>Columns, right-click the state column, and select Properties from the pop-up menu.

  3. Select the Edit Style tab in the Column Properties view and note that the Style Name is StateCode.

  4. In the Extended Attributes view, expand Edit Styles, scroll down to StateCode and select Properties from its pop-up menu.

    The DataWindow option in the Edit Style properties view for StateCode shows that this edit style uses a DataWindow object called d_dddw_states.

    The image shows the Objects, Edit Styles, and Properties views in the database painter with the Edit Style dialog box for the drop down datawindow.
  5. Close the Database painter.

The d_dddw_states DataWindow object is available in the sample library installed with DataWindow Designer. To use it in your application, copy it into your application’s library.

StepsTo copy a DataWindow object from one library to another:

  1. In the Solution Explorer, right-click the DWStart project and select Add Existing Library.

  2. Navigate to the Sybase\DataWindow Designer 2.5\Code Examples directory, select dwdexample.pbl, and click Add.

  3. Right-click d_dddw_states and select Copy from its pop-up menu.

  4. In the Select Library dialog box, navigate to the DWStart.pbl you created for this tutorial and click Open.

    The d_dddw_states DataWindow object displays in your library in the Solution Explorer.

  5. Right-click dwdexample.pbl and select Remove from its pop-up menu.