In PocketBuilder you typically work within an existing database, but you can create a new local SQL Anywhere (Adaptive Server Anywhere) or UltraLite database from within PocketBuilder. You can also delete existing SQL Anywhere databases.
You can create a SQL Anywhere database in the Database painter or the Database Profiles dialog box.
To create a local SQL Anywhere database:
From the Objects view in the Database painter or the Database Profiles dialog box, launch the Create ASA Database utility.
The Create Adaptive Server Anywhere Database dialog box displays. (Adaptive Server Anywhere is the name for previous versions of SQL Anywhere.)
Select the version of SQL Anywhere (ASA Version) that you want to use to create the database, and enter a user ID and password for the new database.
In the Database Name box, specify the file name and path of the database you are creating.
If you do not provide a file extension, the database file name is given the extension DB.
Define other properties of the database as needed.
If you are using a non-English database, you can specify a code page in the Collation Sequence box.
For complete information about filling in the dialog box, click the Help button in the dialog box.
Click OK.
When you click OK, PocketBuilder does the following:
Creates a database with the specified name in the specified directory or folder. If a database with the same name exists, you are asked whether you want to replace it.
Adds a data source to the ODBC.INI key in the registry. The data source has the same name as the database unless one with the same name already exists, in which case a suffix is appended.
Creates a database profile and adds it to the registry. The profile has the same name as the database unless one with the same name already exists, in which case a suffix is appended.
Connects to the new database.
You can delete a SQL Anywhere database in the Database painter or the Database Profiles dialog box.
To delete a local SQL Anywhere database:
From the Objects view in the Database painter or the Database Profiles dialog box, launch the Delete ASA Database utility.
The Delete Local Database dialog box displays.
Select the database you want to delete and select Open.
Click Yes to delete the database.
When you click Yes, PocketBuilder deletes the specified database.
The following procedure shows how to create a new UltraLite database using the UltraLite Schema Painter and Create UltraLite Database utilities. You can also create an UltraLite schema and database from an existing SQL Anywhere database. For an example, see the DWExam example in the Code Examples\DataWindows directory and the chapter on MobiLink synchronization in the Resource Guide.
For more information about creating UltraLite databases, see the UltraLite Database Management Reference book in the online book collection for SQL Anywhere Studio.
To create a local UltraLite database:
From the Objects view in the Database painter or the Database Profiles dialog box, launch the UltraLite Schema Painter utility.
Select File>New>UltraLite Schema.
Click Browse to navigate to the location where you want to create the schema (.USM) file, type a name for the schema file, and click Open.
If necessary, select a different collation sequence, select the check box if you want the database to be case sensitive, and click OK.
You do not need to change the collation sequence for most languages based on the Roman alphabet.
Expand the schema and its Tables folder in the left pane and click Add Table.
The New Table dialog box opens.
Complete the dialog box to add a new table, click OK, and add additional tables as needed.
For complete information about filling in the dialog box, click the Help button.
Click Save and close the UltraLite Schema Painter.
From the Objects view, launch the Create UltraLite Database utility.
The Create UltraLite Database utility runs ulconv, the UltraLite database converter command-line tool.
Click the Browse button next to the UL Schema box and browse to select the schema file you just created.
Click the Browse button next to the New UL DB box, browse to select the path to the new database, enter a name, and click OK.