-Tips & Tools

1. ASP Combo Box (for a list of options)

 Check for Option

2. ASP Check Box (preferable for one option)

   Yes       No

3. ASP Radio Button (preferable for muliple options)

<A HREF=""></A>

4. Adding Links in a Database

Normalized Database

5. Using Related Tables

memberDev 

6. Third-Party Components

This is from the NewsGroups

7. Min/Max Search Fields

1. ASP Combo Box

This is for pages used to search or add info to a database. This cannot usable to update or delete a database. Names and values are not pulled from the database but added manually. Not recommended on a details page. There is also a Third-Party Component made to pull this data from database.

  1. Add a regular Forms ComboBox Component on the page.
  2. Add all the Names and Values you want.
  3. In the Properties Palette change the name of the Forms ComboBox Component to:

    amaspField_nameoffieldondatabase

    * the 'nameoffieldondatabase' should be the name of the field within the database you want this information to be added to.
     
  4. In the Properties Palette click the HTML button.
  5. In the "before tag" add:

    <INPUT NAME="amaspHidden_nameoffieldondatabase_dataType" VALUE="string" TYPE="HIDDEN">

    * again 'nameoffieldondatabase' should be the name of the field within the database you want this information to be added to.
    ** Also change 'string' to the new proper value of the field within the database.
  6. Click OK.

top

2. ASP Check Box (preferable for one option/check box)

This is for pages used to search or add info to a database. This cannot usable to update or delete a database. Values are not pulled from the database but added manually. Not recommended on a details page. Also suggested only when one Check Box is going to be used for referencing a field on the database. This is because more than one Check Box can be checked at a time.

  1. Add a regular Forms CheckBox Component on the page.
  2. Add the Value you want to search or add on the database.
  3. In the Properties Palette change the name of the Forms CheckBox Component to:

    amaspField_nameoffieldondatabase

    * the 'nameoffieldondatabase' should be the name of the field within the database you want this information to be added to.
     
  4. In the Properties Palette click the HTML button.
  5. In the "before tag" add:

    <INPUT NAME="amaspHidden_nameoffieldondatabase_dataType" VALUE="string" TYPE="HIDDEN">

    * again 'nameoffieldondatabase' should be the name of the field within the database you want this information to be added to.
    ** Also change 'string' to the new proper value of the field within the database.
  6. Click OK.

top

3. ASP Radio Button (preferable for multiple options/radio buttons)

This is for pages used to search or add info to a database. This cannot usable to update or delete a database. Values are not pulled from the database but added manually on creation. Not recommended on a details page. Also suggested for when more than one Radio Button is going to be referencing a field on the database. This is because no more than one Radio Button can be selected per group.

  1. Add a regular Forms Radio Button Component on the page.
  2. Add the Value you want to search or add on the database.
  3. In the Properties Palette change the group name of the Forms Radio Button Component to:

    amaspField_nameoffieldondatabase

    * the 'nameoffieldondatabase' should be the name of the field within the database you want this information to be added to.
     
  4. In the Properties Palette of only one of the ASP Radio Buttons using the group name click the HTML button.
  5. In the "before tag" add:

    <INPUT NAME="amaspHidden_nameoffieldondatabase_dataType" VALUE="string" TYPE="HIDDEN">

    * again 'nameoffieldondatabase' should be the name of the field within the database you want this information to be added to.
    ** Also change 'string' to the new proper value of the field within the database.
    *** When dealing with a group of Radial Buttons this hidden field only needs to be added once.
  6. Click OK.

top

4. Adding Links in a Database

If you want a link to a URL in a database to be placed in an ASP page, it must be manually coded. This means you cannot use the URL option. Instead you have to place in a text field within the database:

<A HREF="URL">Text</A>

*URL must be replaced with the URL of the site or page you wish to link to.
*Text must be replaced with the text you would like to see on the ASP page.

When this data is displayed on the database it will display it as a text link.

top

5. Related Tables/ Normalized Database

This follows the Customers & Orders example given in the documentation, and shows you how to make the related records using that data source.

In the example, there are two tables.  One is called Customers, and it has a primary key field called "CustomerID".
The second table is called "Orders" and has a foreign key that matches the Customers.  CustomerID key called "CustID".
What we want to do is set up a DBList for the Customers table that will show the related records in the Order table.
This list of the related orders will be on another page with another DBList.

Set up the page with the Customer table.

  1. As with all ASP pages, the file extension needs to be set to .asp, and the "Layout is a form" checkbox needs to be selected. Like most pages with a DBList component, this page has have three components:
         -- an MSDBConnection component to connect to the database
         -- an MSDBQuery component to select the customer records
         -- an MSDBList component to display the customer records.
  2. Set up your MSDBConnection component to point at your Microsoft Access data source.
  3. In the MSDBQuery component only needs to "SELECT * FROM Customers".  Notice you do not have to set up a connection to the Orders table here.
  4. In the MSDBList component is where you establish the link between DBList and the DBList that will display the Orders records. Set the "Hyperlink Page" field to the page where you want to display your Orders records. For this example, use  a page called "MyOrders".
  5. For "Hyperlink Field" put in "CompanyName".  This is the field in the Customers table where you want to display the hyperlink.
  6. Set the "Key Field Name" and "Key Field Label" fields to CustomerID. Set the "Key Field Type" to number.
    NOTE: This is the critical part of the equation. The "Key Field Name", "Key Field Label" and "Key Field Type" fields define what field is passed to the Hyperlink page.  Since the foreign key in the Orders table, Orders.CustID,  needs to match the value Customer.CustomerID, you want to "broadcast" the Customer.CustomerID field to the "MyOrders" page. This is similar to previous configurations except that now you know that "Key Field Name" and "Key Field Label" are what field is sent to the Hyperlinked page. 

Now set up the "MyOrders" page to display the related records.

  1. On your "MyOrders" page, once again make sure the page extension is set to "asp" and that the "Layout is a form" checkbox is checked.
  2. Place a MSDBConnection, MSDBQuery and MSDBList component on this page.
    NOTE: The MSDBConnection on the "MyOrders" page still just points to your Microsoft Access source. The MSDBQuery is the critical part of this page.  For this example this query is named "MyRelatedQuery", and you should leave the "SELECT" field set to "*".
  3. Set the "FROM" field to "Customers, Orders".
  4. Set the "WHERE" field to "Customers.CustomerID=Orders.CustID".
    NOTE: In the "WHERE" field is where the actual logic occurs.  Since the "Customers.CustomerID" field was passed over from the previous page using the "Key Field Name" field, "myRelatedQuery" knows about its existence. Since this query knows about the Orders table, it knows about its fields. Because of this, the "Customers.CustomerID=Orders.CustID" in the WHERE field can make sure that only matching fields are displayed.
  5. Place a DBList component that lists all the fields from the Orders table that you would like to display. When you publish this site, the Customers page displays all the customers, and if you click on the hyperlink, it  shows all the orders that belong to that customer.

top

Sometimes we all need a little more help getting our ASP pages to work right. Here are some ASP components which may help you add more versatility to your site! Click the image to go to the site.

Henk Laracker’s Free ASP DropDown Component

Henk Laracker’s ASP DropDown Component + The new Yes ASP Checkbox component and the DSN-less ASP connection component as well as much much more!!!

Price: FREE!!!

BitMotion ASP Image Component

BitMotion ASP Image Component

Price: $28.00

Some choose to code your ASP pages manually. Our ASP components will only get them so far. But the problem always come when we try to add code before the <HTML> tag. Well here are some components that may help! However if you have NOF 5.0 you will not need these components.

BitMotion FirstLine Component

BitMotion FirstLine Component

Price: $15.00

CoolMaps LineOne Component

CoolMaps LineOne Component

Price: $19.00 (guest) $9.50 (members)


top

[Troubleshooting] [Components] [Page Architecture] [Tips & Tools] [Links]

Go Back to Previous Page

Have a question that you can´t find the answer to? Want to report a possible bug?

Send a help request to NetObjects Technical Support