Creating and deleting a SQL Anywhere database

In PowerBuilder you work within an existing database. With one exception, creating or deleting a database is an administrative task that is not performed directly in PowerBuilder. The one exception is that you can create and delete a local SQL Anywhere database from within PowerBuilder.

For information about creating and deleting other databases, see your DBMS documentation.

To create a local SQL Anywhere database:

  1. From the Objects view, launch the Create SA Database utility included with the ODBC interface.

    The Create SQL 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.

  4. For complete information about filling in the dialog box, click the Help button in the dialog box.

  5. Click OK.

    When you click OK, PowerBuilder 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.

To delete a local SQL Anywhere database:

  1. Open the Database painter.

  2. From the Objects view, launch the Delete SA Database utility included with the ODBC interface.

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

  4. Click Yes to delete the database.

    When you click Yes, PowerBuilder deletes the specified database.