Example – PB Docs 125

Example

The following example shows how you might synchronize DataWindows between
a PowerBuilder client and an EAServer component.
This example uses a stateless component.

Client window definition

Suppose the client has a window called w_employee that
has buttons that allow the user to retrieve and update data. The
Retrieve button on the client window has the following script:

The Update button on the client window has the following script:

Server object definition

The server has an object called uo_employee that
has the following functions:

  • RetrieveData

  • UpdateData

Instance variables

The uo_employee object has these
instance variables:

Activate

The Activate event for the uo_employee object
instantiates the TransactionServer service. In addition, it connects
to the database and creates the DataStore that will be used to access
the database:

Script for the RetrieveData function

The RetrieveData function takes an argument
called ablb_data, which is a Blob passed
by reference. The function returns a Long value.

Here is the script for the RetrieveData function:

Script for the UpdateData function

The UpdateData function takes an argument
called ablb_data, which is a Blob passed
by reference. The function returns a Long value.

Here is the script for the UpdateData function:

Deactivate

The Deactivate event for the uo_employee object
destroys the DataStore and disconnects from the database:


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