Specifying the database connection and retrieving data – PB Docs 126

Specifying the database connection and retrieving data

Specifying connection information


You provide connection information for the server component
with the SetTrans method. For an ODBC connection to SQL Anywhere,
you specify all the connection information in the dbParm argument. In EAServer, you must also set up a
connection cache for the component, described in “Creating a connection cache
on EAServer 5.x”

Define the data source on the server machine. It must be a
system DSN on EAServer if the
component is running as a service. This statement connects to the
EAS Demo DB sample database:

If you use the XML Web DataWindow, call the SetPageSize method
to limit the number of rows per page:

note.png Using Adaptive Server Enterprise

PowerBuilder and EAServer use
slightly different versions of the CT-Lib software to connect to
Adaptive Server Enterprise via Open Client. In the PowerBuilder
development environment, you use the SYC native database interface
to connect to the database, but you must use SYJ as the first argument to
SetTrans to connect to ASE in EAServer.

Retrieving data


To tell the server component to retrieve data when the DataWindow object
does not have retrieval arguments, you call the Retrieve method:

Specifying retrieval arguments


If the DataWindow
object expects retrieval arguments, call RetrieveEx:

Typically, the retrieval arguments are not constants. They
are page parameters passed to the page from another page where you
filled in a form or clicked a hyperlink. If the DataWindow expects
more than one retrieval argument, the arguments must be passed in
a single string. Separate arguments in the string by newline characters
). Individual values cannot contain newline characters as
part of the value. Separate array values by tab characters ( ).

Getting the retrieval argument from another page works the
first time you load the page. The retrieval arguments have to be
page parameters each time the page is reloaded. To specify page
parameters for the reloaded page, you use the SetSelfLink method.

Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x