Previous Topic

Next Topic

Inhoudsopgave

Book Index

TParam Object

TParam

Description

TParam represents a field parameter for a query or stored procedure.

Details

Use the properties of a TParam to set the value of a parameter that represents the value of a field. Datasets that represent queries and stored procedures create TParam objects to represent the parameters of their query or stored procedures.

TParam shares many properties with TField, as both describe the value of a field in a dataset. However, a TField object has several properties to describe the field binding, and how the field is displayed, edited, or calculated that are not needed in a TParam object. Conversely, TParam includes properties that indicate how the field value is passed as a parameter.

TParam Properties

Property Property Name: String (R/W)

Specifies the name of the parameter.

Property Property ParamType: Integer (R/W)

Indicates the type of the parameter the TParam represents.

Objects that use TParam objects to represent field parameters set ParamType to indicate how the parameter is used. ParamType must be one of the following values:

Note: It is important to group the parameters by type. E.g. set all input parameters first, then set all output parameters.

Property Property DataType: TFieldType (R/W)

Indicates the type of field whose value the parameter represents.

TFieldType is a set of values that parallel the data types of fields in tables.

The most common used fieldtypes are:

1 : String

2 : Smallint

3 : Integer

5 : Boolean

6 : Float

11 : DateTime

The complete set of types:

Property Property Value: Variant (R/W)

Represents the value of the parameter as a Variant.

Code Snippet

Set aCountry = xspCountry.Params.Add

aCountry.Name = "@CountryCode"

aCountry.ParamType = 1 'input

aCountry.DataType = 1 'string

aCountry.Value = edtCountryCode.Text 'take the value of Edit1