Lesson 7: Creating an Employee List  Lesson 7: Creating an Employee List


Create a DSN for ASA 9

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, depending on the type of DSN, the ID and password of the user.

NoteYou might be able to omit this section if you are using SQL Anywhere 9 If you are using the Royalty-Free Runtime, you do need to create the DSN as described in this part of the lesson. If you are using the SQL Anywhere 9 (developer version) however, a DSN for ASA 9 will already be on the device if ASA is installed with the sample data option selected. If so, you can omit this section and simply open the DSN file and verify that the paths used are valid. With the Royalty-Free Runtime, the start line in the DSN points to rteng9.exe. With ASA 9, the start line points to dbsrv9.exe.

  1. If you are using the SQL Anywhere 9 (developer version), you do not need to create a DSN, so you can skip to “Build and deploy the application”.

    Note that a DSN for ASA 9 that looks like the following will already be on the device when ASA is installed with the sample data option selected.

    Shown is the Customer window titled Maintain Customers 1. Across the top half of the screen are the column headings Customer I D, First Name, Last Name, and Company Name. They have rows of actual data and a hand icon at the left points to the top row. The bottom half of the screen shows data in labeled text boxes on the left side for Customer I D, First Name, Last Name, Company Name, and Phone Number. On the right side are labeled text boxes with data for Address and City, a drop down for State set to NJ, and then a text box with data for Zip Code.
  2. If you are using the Royalty-Free Runtime, open Notepad or WordPad and create a DSN file with the following content:

    [ODBC]
    uid=dba
    pwd=sql
    enginename=ASADemo
    databasename=ASADemo
    databasefile=\Program Files\Sybase\ASA\asademo.db
    start=\Program Files\Sybase\ASA\rteng9.exe -q
    

    NoteWhat -q means Notice that in this DSN, the start line ends with a -q that means quiet. If you use the -q, when you run the application on the Pocket PC, ASA starts without displaying a log screen and your application starts immediately.

  3. Save the file as ASA 9.0 Sample.dsn in a temporary directory.

    Shown is the Customer window titled Maintain Customers 1. Across the top half of the screen are the column headings Customer I D, First Name, Last Name, and Company Name. They have rows of actual data and a hand icon at the left points to the top row. The bottom half of the screen shows data in labeled text boxes on the left side for Customer I D, First Name, Last Name, Company Name, and Phone Number. On the right side are labeled text boxes with data for Address and City, a drop down for State set to NJ, and then a text box with data for Zip Code.




Copyright © 2004. Sybase Inc. All rights reserved. Lesson 7: Creating an Employee List

View this book as PDF