ADO Direction Property

Definition and Usage

The Direction property can be set or return a ParameterDirectionEnum value indicating whether the Parameter represents an input parameter, an output parameter, both, or whether the parameter is a return value of a stored procedure. The default value is adParamInput.

The Direction property is read/write, allowing the user to use providers that do not return this information, or to set this information when the ADO does not need to call the provider an extra time to retrieve parameter information.

Not all providers can determine the parameter direction in their stored procedures. In this case, the Direction property must be set before executing the query.

syntax

objparameter.Direction

instance

<%
set comm=Server.CreateObject("ADODB.Command")
set para=Server.CreateObject("ADODB.Parameter")
para.Type=adVarChar
para.Size=25
para.Direction=adParamInput
para.Value=varfname
comm.Parameters.Append para
%>

Valeurs de ParameterDirectionEnum

Constante Valeur Description
adParamUnknown 0 Indique que la direction de ce paramètre est inconnue.
adParamInput 1 Valeur par défaut. Indique que ce paramètre est un paramètre d'entrée.
adParamInputOutput 3 Indique que ce paramètre est à la fois un paramètre d'entrée et un paramètre de sortie.
adParamOutput 2 Indique que ce paramètre est un paramètre de sortie.
adParamReturnValue 4 Indique que ce paramètre est une valeur de retour.