GetParameters Method

Applies To

ODatabase

Description

This method returns an OParameterCollection object that contains the parameters of the database.

Usage

OParameterCollection GetParameters(void) const

Remarks

To add or remove parameters from a database, for use with dynasets on that database, you must use an OParameterCollection.

Return Value

An OConnectionCollection, which will be open on success, closed on failure.

Example

This example adds a parameter to an existing ODatabase (odb) and uses it to open an ODynaset:

// open a database

ODatabase odb("ExampleDB", "scott", "tiger");

// now add a parameter named ourdeptno to the database

OParameterCollection params = odb.GetParameters();

params.Add("ourdeptno ", 20, OPARAMETER_INVAR, OTYPE_NUMBER);

// now create and open a dynaset using that parameter

ODynaset dyn(odb, "select * from emp where deptno = :ourdeptno");