Lesson 1: Setting up your Excel worksheet

In this lesson, you create an Excel worksheet and use the Microsoft Excel Driver to define an ODBC data source. The Excel worksheet stores product information.

To set up your Excel data source

  1. Create an Excel worksheet with the following contents:

    order_id comment_id order_comment
    1 2 Promotional material shipped
    1 3 More information about material required
  2. Change the default worksheet name Sheet1 to order_sheet.

    • Double-click the Sheet1 tab.
    • Type order_sheet.
  3. Save the Excel workbook.

    This tutorial assumes c:\MLobjexcel as the working directory for server-side components. Save the workbook as order_central.xls in this working directory.

  4. Create an ODBC data source using the Microsoft Excel Driver:

    • Start the ODBC Administrator.

      From the Start menu, choose Programs » SQL Anywhere 11 » ODBC Administrator.

    • On the User DSN tab, click Add.

      The Create New Data Source window appears.

    • Select Microsoft Excel Driver (*.xls) and click Finish.

      The ODBC Microsoft Excel Setup window appears.

    • Type the Data Source Name excel_datasource.
    • Click Select Workbook and browse to c:\MLobjexcel\order_central.xls (the file containing your worksheet).
    • Click OK to create the data source. Click OK again to exit the ODBC Administrator.