Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Test the new sheet window – PB Docs 2022 – PowerBuilder Library

Test the new sheet window – PB Docs 2022

Test
the new sheet window

  1. Click the Run button (zzrun.gif) in the PowerBar.

    If PowerBuilder prompts you to save changes, click Yes.

  2. Type dba in the User ID box.

    Type sql in the Password box and click OK.

    The database connection is established, and the MDI frame for
    the application displays.

  3. Select File>Report>Customer Location from the menu
    bar.

    The Customer Location window displays. The current entry in
    the drop-down list is AB for Alberta.

    custloc.gif
  4. Click the Percentage button.

    Because there is only one customer in Alberta, the
    exc_low_number user-defined exception is thrown. The message from
    the exception is displayed in a message box that was defined in a
    CATCH clause in the button Clicked event.

  5. Click OK to close the message box.

    The text in the static text boxes now displays the number of
    customers in Alberta and the total number of customers in the
    database. The text in the editable text box tells you the value was
    not calculated and prompts you to select another state.

    custloc2.gif
  6. Select or type CA in the drop-down list box and click the
    Percentage button.

    The results from the database show 10 customers in California
    for a total of 7.9% of all customers in the database. The percentage
    may be different if you have modified the database.

    custloca.gif
  7. Type Ohio into the drop-down list box and click the Percentage
    button.

    When you lose focus from the drop-down list box by clicking
    the Percentage button control, the LoseFocus event fires. This event
    calls the ue_modified event that throws the exc_bad_entry
    user-defined exception. The exception message tells you to use a
    two-letter postal code for the state name.

  8. Click OK to close the message box, type US in the drop-down
    list box, and click the Percentage button.

    Because no rows are found in the database with US as the state
    code, the exc_no_rows exception is thrown. A message displays
    indicating no rows have been returned and suggests reasons why that
    might be the case. A more robust application might compare the typed
    text to a list of state codes and throw the exc_bad_entry exception
    instead, letting you know that US is not a state code.

  9. Click OK to close the message box.

  10. Right-click the database icon for the Demo Database, a red and
    yellow SQL symbol (zsql.gif), in your Windows System Tray.

  11. Select Shut down from the pop-up menu, and click Yes in the
    Warning message box that displays.

    This shuts down the connection to the Demo Database.

  12. Select or type AB again in the drop-down list box and click
    the Percentage button.

    The message from the exc_no_rows exception object displays for
    Alberta because the connection to the database was closed. To obtain
    results again, you need to terminate the application and restart it.
    PowerBuilder reestablishes a connection to the database at runtime
    when you restart the application.

  13. Click OK to close the message box and select File>Exit from
    the application menu to return to the development
    environment.

    The Database painter and the Database Profile painter might
    still list the database connection as being open. In this case you
    can use either painter to disconnect and reconnect to the database
    at design time.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x