Create an ODBC data source to connect to your Windows Mobile device

This section describes how to create an ODBC data source on your Windows desktop computer that connects to a database running on your Windows Mobile device.

For more information about ODBC data sources, see Creating ODBC data sources.

 To create an ODBC data source to connect to your Windows Mobile device
  1. On the Windows desktop computer, choose Start » Programs » SQL Anywhere 12 » Administration Tools » ODBC Data Source Administrator.

  2. On the User DSN tab, click Add.

  3. Select SQL Anywhere 12, and then click Finish.

  4. On the ODBC tab, in the Data Source Name field, type MobileServer.

  5. Click the Login tab.

    • Authentication   Choose Database.

    • User ID   Make sure this field is blank. Each time you connect to a database, you must supply a user ID and password.

    • Password   Make sure this field is blank. The Encrypt Password box should be cleared.

    • Action   Select Connect To A Database On Another Computer.

    • Host   If you connected a Windows Mobile 5.0 or 6.0 device using Windows Mobile Device Center (ActiveSync) over a USB connection, try the Windows Mobile device IP address 169.254.2.1.

      For some Windows Mobile devices, especially older devices, you might encounter difficulty using this address. If so, try the localhost (127.0.0.1) IP address. In this case you must also have set up a proxy port. For information on setting up a proxy port, see Creating proxy ports for Windows Mobile devices.

      For more information, see Determine the IP address of your Windows Mobile device.

    • Port   Specify the port number that the Windows Mobile device listens on.

      Use the port that the database server on the Windows Mobile device is configured to use when it is started. It is recommended that you use port 2639. See Start a database server on your Windows Mobile device.

    • Server Name   Fill in the server name if you wish to connect to a specific database server running on the Windows Mobile device. Otherwise, make sure this field is blank.

    • Database Name   Fill in the database name if you wish to connect to a specific database running on the Windows Mobile device. Otherwise, make sure this field is blank.

  6. Click OK.

You can now use this data source to connect from a Windows desktop computer to a database running on your Windows Mobile device.

To test the connection, you can use the dbping utility. If a database has been started on the Windows Mobile device, then use a command like the following to test the connection.

dbping -c "DSN=MobileServer;UID=DBA;PWD=sql"

For more information, see Using the administration utilities on Windows Mobile.