Creating databases

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.

Creating a SQL Anywhere database

You can create a SQL Anywhere database in the Database painter or the Database Profiles dialog box.

StepsTo create a local SQL Anywhere database:

  1. 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.)

  2. 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.

  3. 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.

  4. 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.

  5. Click OK.

    When you click OK, PocketBuilder does the following:

Deleting a SQL Anywhere database

You can delete a SQL Anywhere database in the Database painter or the Database Profiles dialog box.

StepsTo delete a local SQL Anywhere database:

  1. 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.

  2. Select the database you want to delete and select Open.

  3. Click Yes to delete the database.

    When you click Yes, PocketBuilder deletes the specified database.

Creating an UltraLite 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.

StepsTo create a local UltraLite database:

  1. From the Objects view in the Database painter or the Database Profiles dialog box, launch the UltraLite Schema Painter utility.

  2. Select File>New>UltraLite Schema.

  3. 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.

  4. 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.

  5. Expand the schema and its Tables folder in the left pane and click Add Table.

    The New Table dialog box opens.

  6. 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.

  7. Click Save and close the UltraLite Schema Painter.

  8. From the Objects view, launch the Create UltraLite Database utility.

    The Create UltraLite Database utility runs ulconv, the UltraLite database converter command-line tool.

  9. Click the Browse button next to the UL Schema box and browse to select the schema file you just created.

  10. 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.