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.
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.
ODBC 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.
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.
In ActiveSync, click Tools>Explore Device.
A view of files in the Pocket PC displays.
Double-click My Pocket PC (or My Windows Mobile-Based Device).
This brings you to the root directory ( \ ).
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.
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.
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.
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.
Repeat the previous step for the log file, ASADemo_10.log
.
Now you are ready to build and deploy the application.