UltraLite Database User's Guide
Utility Programs
The UltraLite Schema Painter
In this tutorial, you build a single-table database schema and export it to Palm.
For more information on UltraLite schemas, see Databases and schema files.
When creating UltraLite schemas for a Palm device, the following information is necessary:
A way to identify the database so an application can connect to it. This is done with the Palm creator ID.
A way to identify the schema on the development machine so it can be copied to the device.
A way to identify the schema on the device.
To complete this tutorial you need a directory to hold the files you create. This directory is assumed to be C:\tutorial\. If you create your tutorial directory elsewhere, supply the path to your location instead of c:\tutorial\ throughout.
To create a schema file using the UltraLite Schema Painter
Start the UltraLite Schema Painter:
Click Start
Create a new schema file called tutCustomer.
From the File menus, select New
In the file dialog box, type c:\tutorial\tutCustomer.usm or Browse to the folder and enter tutCustomer.
Click OK to create the schema.
Create a table called customer.
Expand the tutCustomer item in the left pane of the UltraLite Schema Painter and select the Tables folder.
Open the Tables folder and double-click Add Table. The New Table dialog appears.
Enter the name customer.
In the New Table dialog, add columns with the following properties.
Column name | Data type (Size) | Column Allows NULL values? | Default value |
---|---|---|---|
Id | integer | No | autoincrement |
Fname | char (15) | No | None |
Lname | char (20) | No | None |
City | char (20) | Yes | None |
Phone | char (12) | Yes | 555-1234 |
Set Id as the primary key: click Primary Key and add Id to the index, marking it as ascending.
Check your work and click OK to complete the table definition and dismiss the New Table dialog.
Click File
Export a Palm schema file.
Right click on the database icon and select Export Schema for Palm from the popup menu.
Enter a Palm Creator ID of Syb3.
A note on Palm Creator IDsA Palm creator ID is assigned to you by Palm. You can use Syb3 as your creator ID when you make sample applications for your own learning. However, when you create your commercial application, you should use your own creator ID. |
Leave the filename at its default setting to save the PDB file in your tutorial directory. Click OK.
Exit the UltraLite Schema Painter.
You have now defined the schema of an UltraLite database. Although this database contains only a single table, you can use many tables in UltraLite databases.