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

In the General tab, enter the data shown below:

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:

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 box.

  • No labels