Logging your work  Working with tables

Chapter 16: Managing the Database

Creating databases

In PocketBuilder you typically work within an existing database, but you can create a new local ASA or UltraLite database from within PocketBuilder. You can also delete existing ASA databases.

Creating an ASA database

You can create an ASA database in the Database painter or the Database Profiles dialog box.

StepsTo create a local ASA 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.

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

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

  4. Click OK.

    When you click OK, PocketBuilder does the following:

Deleting an ASA database

You can delete an ASA database in the Database painter or the Database Profiles dialog box.

StepsTo delete a local Adaptive Server 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 ASA 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 User’s Guide in the online Help 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.





Copyright © 2004. Sybase Inc. All rights reserved. Working with tables

View this book as PDF