When to set the PGDBE client license for an application?

I Love Xbase++ (ILX)
The portal for Xbase++ developers worldwide

Pat France

New member
Staff member
I am here to help you!
Aug 9, 2022
22
3
3
Customer Identifier
E114627
There are basically two preconditions for an application to be able to successfully establish a connection to a PostgreSQL database:
  • The PGDBE must be loaded using DbeLoad()
  • On a non-developer machine, a client license must be specified for connecting to the PostgreSQL server. *)
*) Note that on a developer machine, the active development tool license is automatically detected, hence no dedicated PostgreSQL client license is required

These preconditions are deemed critical, because if they are not met, the application will not be able to use or connect to the PostgreSQL server. It is therefore recommended to perform these two steps together, either in the DbeSys() procedure, or in another code location guaranteed to be executed before the first connection attempt is made.

Xbase++:
//
// Load PGDBE and set it up for accepting connections
//

DbeLoad( "PGDBE" )

// Ensure PGDBE is the default DBE, as DbeInfo() always operates on the default DBE
DbeSetDefault( "PGDBE" )

// Set license key and licensee for the DBE and therefore for all future connections
DbeInfo( COMPONENT_DICTIONARY, PGDIC_LICENSE, "licensekey=<your-license-key>;licensee=<your-licensee-name>;")
 
Last edited: