Defining the UltraLite database interface

To define a connection through the UltraLite database interface, you must create a database profile by supplying values for at least the basic connection parameters in the Database Profile Setup dialog box for UltraLite. You can then select this profile at any time to connect to the UltraLite database. For more information, see “Creating database profiles”.

Specifying the database file

Each UltraLite application has its own database, which is held in a file with the extension .UDB. Each database contains a schema that includes information about the database’s tables, indexes, column names, datatypes, primary and foreign keys, and other metadata. The schema for an UltraLite database is stored in a compact form.

You can create an UltraLite database in the Database painter. For more information, see the chapter on managing databases in the User’s Guide. You can also create an UltraLite database using a reference SQL Anywhere database.

When you browse to select a database file in the Database Profile Setup dialog box, PocketBuilder adds a DBF value to the ConnectString database parameter.

Connecting to an encrypted UltraLite database

You can choose to specify the encryption key for an encrypted database by typing it in the Additional ConnectionString Parameters box on the general page of the Database Profile Setup dialog box for UltraLite. Use the following syntax:

KEY=encryption_key

However, this practice is not recommended. If you leave the Additional ConnectionString Parameters box blank, you are prompted to enter the key when you connect.

In your applications, you can code the encryption key in the ConnectString value when you specify the DBParm property of the transaction object, but to ensure that only authorized users can access the database, provide a dialog box so that users can enter the key at runtime.

Setting Autocommit mode

In the development environment, PocketBuilder always behaves as if AutoCommit is set to true, whether you check the AutoCommit mode check box or not. The setting in the Database Profile Setup dialog box affects the behavior only when you run or debug the application. For more information, see the description of the AutoCommit database preference in the Connection Reference.

Adding multiple users

PocketBuilder allows you to add or edit multiple users of UltraLite databases. UltraLite permits a maximum of four user IDs per database. For UltraLite database profiles, you can use the pop-up menu for the new Users item in the Objects view of the Database painter to add or edit users, and to delete users.

When you select Add or Edit User from the User item pop-up menu for an UltraLite database, or when you select Delete User, you should already know which user IDs exist in the database. If you select either of these menu items, the Properties view displays. The Properties view has three text boxes (User, New Password, and Confirm New Password) when you select Add or Edit User; it has a single text box (UltraLite User to Delete) when you select Delete User.

After you save changes in the Database painter involving user maintenance for an UltraLite database, the Output view displays a message with the type of change you made.