Versions Compared

Key

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

By creating Before rewriting the code, we need to create a data set with that will retrieve the company names from the NWIND CUSTOMERS table.  Launch the Client/Server Workspace '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:

and select File New from the menu.  Choose a new DataSet entity, as shown below:

Image Added

In the General tab, enter the data shown below:

Image Added

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 Added

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

Save the definition as CUSTOMERS_NWIND.  This data set will be used in the revised BASIC+ code to populate the combo boxIn 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 Access.