Direction Property (DAO)

Microsoft DAO 3.60

Direction Property

           

Sets or returns a value that indicates whether a Parameter object represents an input parameter, an output parameter, both, or the return value from the procedure (ODBCDirect workspaces only).

Settings And Return Values

The setting or return value is a Long that can be set to one of the following constants:

Constant Description
dbParamInput (Default) Passes information to the procedure.
dbParamInputOutput Passes information both to and from the procedure.
dbParamOutput Returns information from the procedure as in an output parameter in SQL.
dbParamReturnValue Passes the return value from a procedure.

Remarks

Use the Direction property to determine whether the parameter is an input parameter, output parameter, both, or the return value from the procedure. Some ODBC drivers do not provide information on the direction of parameters to a SELECT statement or procedure call. In these cases, it is necessary to set the direction prior to executing the query.

For example, the following procedure returns a value from a stored procedure named "get_employees":

{? = call get_employees}

This call produces one parameter — the return value. You need to set the direction of this parameter to dbParamOutput or dbParamReturnValue before executing the QueryDef.

You need to set all parameter directions except dbParamInput before accessing or setting the values of the parameters and before executing the QueryDef.

You should use dbParamReturnValue for return values, but in cases where that option is not supported by the driver or the server, you can use dbParamOutput instead.

Note   The Microsoft SQL Server 6.0 driver automatically sets the Direction property for all procedure parameters. Not all ODBC drivers can determine the direction of a query parameter. In these cases, it is necessary to set the direction prior to executing the query.