Copy the DSN file and database to the Pocket PC

Note

A data source name (DSN) file is a data structure that contains the information about a specific database that an ODBC driver needs in order to connect to it. Included in the DSN, which resides either in the registry or as a separate text file, is information such as the name, directory, and driver of the database, and, optionally, the ID and password of the user.

For the this tutorial, you rely on a registry DSN for the design-time database connection, but a file DSN on the handheld device. The ODBC profile name for the registry DSN has the same name as the file DSN that you copy to the Pocket PC, so you do not need to change the of_getconnectioninfo function script of the n_emplist_tutorial_connectservice user object that you generated with the wizard.

  1. Open the DemoDB_SA10.DSN in a text editor.

    Examine the contents of this DSN file.

    The DSN file is installed in the Code Examples\SADemoData\SA10 subdirectory by the PocketBuilder setup program. It references the default path to SQL Anywhere 10 on a Pocket PC device. If you installed SQL Anywhere to a nondefault location, you must change at least the start line in this DSN file. For example, if you installed SQL Anywhere on the storage card, you might need to add \Storage before the default path to the database file and the database start line.

    Shown are the contents of the D S N file. This D S N file sets the user I D, password, driver, engine name, database name, database file, and start line.

    NoteODBC driver setting By default, PocketBuilder assumes the driver for a remote database is dbodbc10.dll. If you are using Adaptive Server Anywhere 9, you must set the driver to dbodbc9.dll, either in the DSN file or in the database connection string. The DemoDB_SA10.DSN file in the Code Examples\SADemoData\SA10 subdirectory sets the ODBC driver for SQL Anywhere 10. The ASA 9.0 Sample.DSN file in the Code Examples\SADemoData\ASA9 subdirectory sets the ODBC driver for Adaptive Server Anywhere 9.

    Next, you copy the DSN to the root directory of the Pocket PC device and the ASADemo_10.db database and its log file, ASADemo_10.log, to the \Program Files\SQLAny10 directory of the device.

  2. If your Pocket PC is not on, turn it on, and connect to it from the desktop using ActiveSync.

    ActiveSync displays on the desktop and connects to your Pocket PC.

    Shown is the Microsoft Active Sink screen on the desktop. The Active Sync screen indicates that a connection to the pocket p c device is established.
  3. In ActiveSync, click Tools>Explore Device.

    A view of files in the Pocket PC displays.

    Shown is the Explorer window that you open from Active Sink. The root directory displays as My Pocket P C. Subdirectories that display are Business, Personal, and Templates.
  4. Double-click My Pocket PC (or My Windows Mobile-Based Device).

    This brings you to the root directory ( \ ).

  5. Using the Windows Explorer on the desktop, copy the DemoDB_SA10.DSN file to the Pocket PC root directory.

    To copy this file, you can drag it from the PocketBuilder Code Examples\SADemoData\SA10 directory in Windows Explorer and drop it in the Pocket PC root directory displaying in the Explorer window that you opened from ActiveSync, or you can use the Edit>Copy and Edit>Paste menu items in the same or separate Explorer windows.

    Shown is the Explorer view of the root directory on the Pocket P C device.
  6. In the Explorer window that you opened from ActiveSync, change directories to the main SQL Anywhere directory on the Pocket PC.

    The default directory for SQL Anywhere on a Pocket PC device is /Program Files/SQLAny10.

  7. Using Windows Explorer, copy ASADemo_10.db from the PocketBuilder Code Examples\SA10 Demo Data directory on the desktop to the \Program Files\SQLAny10 directory of the device.

    Shown is the Explorer view of the SQL Anywhere directory on the Pocket P C device.

    You might need to close PocketBuilder, or to disconnect from the database in PocketBuilder. before you can copy the database file from the desktop to the mobile device.

  8. Repeat the previous step for the log file, ASADemo_10.log.

    Now you are ready to build and deploy the application.