Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Before rewriting the code, we need to create By creating a data set that will retrieve the company names from the NWIND CUSTOMERS table.  Launch with the Client/Server Workspace and select File New from the menu.  Choose a new DataSet entity, as shown below:

Image Removed

In the General tab, enter the data shown below:

Image Removed

The Data Source is the NWIND Connection Object defined in the example that we are rewriting.  (Click here to see how the connection is defined.)

Click on the Scripts tab.  We need to define the SQL SELECT statement for retrieving the company values.  Instead of specifying this by building a variable in BASIC+, the statement is stored in the Data Set.  The SQL SELECT statement can return one, all, or a subset of all the rows.  In this case, we only need to return the CompanyName column.  Enter as shown below:

Image Removed

Then click the Define Columns button.  This will make the data set define the CompanyName column in the Columns tab.

's Data Set Designer the code can be significantly reduced.  The data set definition contains pre-defined definitions of the table columns; the Select. Insert, Delete, and Update SQL Statements; and the Data Source.  The BASIC+ program calls the data set oriented functions, passing arguments to accomplish many tasks.  These functions are:

In this example, we will create a data set using the Data Set Designer, and then use the data set in rewriting the code to populate a combo box from Microsoft AccessSave the definition as CUSTOMERS_NWIND.  This data set will be used in the revised BASIC+ code to populate the combo box.