TableHandlingADO

Use this component to set the handling total on an order based on values retrieved from the database.

Intended use: Order Processing pipeline, Handling stage.

Configuration Values

You can determine when the TableHandlingADO component calculates the handling charge by setting component properties. Use the following boxes on the Table Handling (ADO) tab of the Component Properties dialog box to determine this information.

Box Description
Apply when Determines when to apply the handling charge. The values are:
Always
Default. Specifies that the handling charge is always applied to the order.
Equal to method
The handling charge should be applied when the value of shipping_method key in the Order dictionary is the same as the string specified in the Method box.
Has any value
Specifies that the handling charge should be applied when the shipping_method key of the order has any non-null value.
Method The shipping method to match against the value of the shipping_method key in the Order dictionary. Used when the value in the Apply when box is set to the value in the Equal to method box.
Connection String The connection string to connect to the database. This may be a full DSN or a name in a connection map. If blank, the default connection string is used.
Query The full SQL text of the query this component will run, or the name of a query whose full SQL text is defined in the Global.asa file in the QueryMap key.
Parameter List The parameters the component passes to the query. Separate multiple parameters with a single space. The following are the allowed parameters:
count
Passes the query the number of line items on the order.
order.fieldname
Passes the value of the specified field in the order form.
sum.fieldname
The query receives the sum of a particular field on the order.
sumq.fieldname
Passes the sum times the respective quantities.
Column The name of the column in the database containing the handling charge.

Values Read

The TableHandlingADO component reads the following values from the indicated dictionaries.

Key Dictionary Description
shipping_method Order Optional. The shipping method as a string.
DefaultConnectionString Context Optional. The key in the Application dictionary containing the default query string.
ConnectionStringMap Context Optional. The map in which to look up the name of a mapped connection string.
QueryMap Context Optional. A reference to a dictionary containing a query map.

Values Written

The TableHandlingADO component assigns a value to the following key in the Order dictionary.

Key Description
_handling_total The total cost for handling the order.

Remarks

The TableHandlingADO component sets the value of the _handling_total key on the order form using values retrieved from the database.

The combination of the values in the Apply when and Method boxes determine whether or not the handling charge is applied to the order.

The TableHandlingADO component first checks the Apply when value. If it is set to Always, the handling charge is always applied to the order. If the value in the Apply when box is set to Has any value, the handling charge is applied to the order whenever the order form contains any value for the shipping_method key. If the value in the Apply when box is set to Equal to Method, the component does a comparison between the value of the shipping_method key on the order form and the text string in the Method box on this property page. If there is a match, the handling charge is applied.

If the component determines that the handling charge should be applied, it runs the query specified in the Query box. The query retrieves the handling charge from the database column specified in the Column box. The component then computes the handling charge.

The connection string must include either the full connection string (the data source name (DSN), database login ID, and database password) or the name of a named connection stored in the connection map.

Copyright © 2005 Microsoft Corporation.
All rights reserved.