By default, PocketBuilder opens a database connection the first time you open a painter requiring a connection, and it maintains the connection until you exit.
When you connect to a database in the PocketBuilder development environment without using a database profile, you can set the Keep Connection Open database preference to specify when PocketBuilder should close the database connection. The setting of Keep Connection Open has no effect when you use a database profile to connect in PocketBuilder.
You cannot set the Keep Connection Open database preference in a PocketBuilder application script.
In the Database painter, select or clear the Keep Connection Open check box in the Database Preferences dialog box as follows:
Select the check box (Default) Stays connected to the database throughout your PocketBuilder session and closes the connection when you exit.
Clear the check box Opens the database connection when a painter requires it and closes the connection when you close a painter or finish compiling a script.
The Keep Connection Open check box in the Database Preferences dialog box is selected by default.
Requirements for using Keep Connection Open To use the Keep Connection Open database preference, both of the following must be true:
Working in PocketBuilder development environment You must be working in the PocketBuilder development environment.
Using default connection information PocketBuilder must use the most-recently used connection information in the Windows registry to connect to the database. Keep Connection Open has no effect when you select a database profile to connect to the database.
What happens If you meet both of these requirements, clearing the Keep Connection Open check box opens a database connection only when you are working in a painter that requires a connection; it closes the connection at other times. This can save you money if you are accessing a database that charges for connect time.