© 2000 Malcolm Hardy All rights reserved
  Generate data bound ASP forms









 

 

 


Tutorial

The following steps illustrate how to create a databound ASP web form using the ASPDataForm Wizard.

Start ASPDataForm Wizard.

introduction

Step 1.

Click on the Next button to move to the next screen of the Wizard. You will then be presented with a wizard screen which requires you to enter the Data Source Connection string. This can either be a DSN or DSN-less connection string.

For this example we will enter a DSN connection as;

dsn=biblio

After entering the above click on the next button.

(Previously a Datasouce Name was configured in the 32 Bit ODBC administrator with the name biblio which points to the sample Microsoft Access Database called biblio.mdb.)

Step 1 - enter dsn

Step 2.

We will now enter an SQL select command to select data from a table within the biblio database.

Enter;

select * from titles

After entering the above click on the next button.

Step 2 Enter SQL

Step 3.

We now need to select the columns we want to be shown on the web form. We will click on the >> button to select all the columns on the left.

After selecting the columns click on the next button.

Step 3 Select Columns

Step 4.

You will now be presented with a screen displaying the various properties available for each of the selected columns in the database table. These properties can be modified by clicking in the appropriate cell. After the properties have been set click on the next button.

Step 4 Set Column Properties

Step 5.

You will now be shown a screen displaying the html table properties, form button options, database table update columns, author name, company and a number of other properties.



We will change the name of the page from the default to titles. We must also change the DatabaseType to Access by clicking in the cell to the right to pick this from the dropdown list of database types. We will also scroll down to the UpdateDatabaseTable property and click on the cell to choose the title table from the dropdown list. We will then double click in the cell to the right of the UpdateWhereColumns property to open the Update Where Columns dialog box.



We must then click on ISBN column. This column is the primary key which will be used to select , update and delete records from the database. You can select as many columns as are necessary. If required you may also manually alter the generated ASP code at a later stage. After completing these steps click on the next button.

Step 6.

The final screen will now be displayed. This screen displays the generated ASP code for the databound web html form. You can either select and copy the code to the clipboard or click on the Save button to save the ASP page to a selected directory. When the page is saved a template is automatically saved in the same directory as the wizard. It is given the same name as the ASP page with an extension 'TPL'.



You can now exit the Wizard by clicking on the Cancel button or by closing the Wizard window by clicking on the close box in the right right hand corner.


Now we can view our completed page in a web browser. You must of course have a web server running which supports ASP. Click on the Retrieve button to retrieve all the records.