adoConnParmGet
Previous Topic  Next Topic 

Synopsis:

       adoConnParmGet(handle,parmID,&pValue)

Arguments:

       handle        - The connection handle.

       parmID        - The parameter ID

       pValue        - Pointer to the variable that will hold the parameter value


Description:   This function enables the underlying connection parameters to be examined for the connection defined by handle.     The parmID argument is the ID of the parameter that is to be read and the pValue is a pointer to a variable that will hold the returned parameter value.       The parmID should be set to one of the following values as defined in the ado.inc file supplied with the library as follows:


################# CONNECTION PARAMETERS ###############

const P_CON_ATTRIBUTES       =101;         # Sets or returns the attributes of a Connection object

const P_CON_COMMANDTIMEOUT   =102;         # Sets or returns the number of seconds to wait while attempting to execute a command

const P_CON_CONNECTIONSTRING =103;         # Sets or returns the details used to create a connection to a data source

const P_CON_CONNECTIONTIMEOUT=104;         # Sets or returns the number of seconds to wait for a connection to open

const P_CON_CURSORLOCATION   =105;         #  Sets or returns the location of the cursor service

const P_CON_DEFAULTDATABASE  =106;         #  Sets or returns the default database name

const P_CON_ISOLATIONLEVEL   =107;         #  Sets or returns the isolation level

const P_CON_MODE             =108;         #  Sets or returns the provider access permission

const P_CON_PROVIDER         =109;         #  Sets or returns the provider name

const P_CON_STATE            =110;         #  Returns a value describing if the connection is open or closed

const P_CON_VERSION          =111;         #  Returns the ADO version number



These constants are mapped to the equiivalent properties in the underlying _Connection object as follows:


Property

Readable

Writeable

Description

Attributes

Sets or returns the attributes of a Connection object

CommandTimeout

Sets or returns the number of seconds to wait while attempting to execute a command

ConnectionString

Sets or returns the details used to create a connection to a data source

ConnectionTimeout

Sets or returns the number of seconds to wait for a connection to open

CursorLocation

Sets or returns the location of the cursor service

DefaultDatabase

Sets or returns the default database name

IsolationLevel

Sets or returns the isolation level

Mode

Sets or returns the provider access permission

Provider

Sets or returns the provider name

State


Returns a value describing if the connection is open or closed

Version


Returns the ADO version number


For those parameters that are restricted to a set of enumerated values, then the equivalent constants have been defined in the ado.inc include file for those enumerations.     For example, the LockType property of the _Connection property can take on one of the following enumerated values:


adLockBatchOptimistic

4

Indicates optimistic batch updates. Required for batch update mode.

adLockOptimistic

3

Indicates optimistic locking, record by record. The provider uses optimistic locking, locking records only when you call the Update method.

adLockPessimistic

2

Indicates pessimistic locking, record by record. The provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately after editing.

adLockReadOnly

1

Indicates read-only records. You cannot alter the data.

adLockUnspecified

-1

Does not specify a type of lock. For clones, the clone is created with the same lock type as the original.


The equivalent constants for these enumerated values are defined in ado.inc as follows:


# Lock type constants

const    adLockUnspecified = "-1";

const    adLockReadOnly = 1;

const    adLockPessimistic = 2;

const    adLockOptimistic = 3;

const    adLockBatchOptimistic = 4;


[See the Microsoft ADO Reference Libary for more details].


Returns:   Returns 0 upon success or a negative error code.   If ADOERR_COMERR is returned, then the underlying ADO error can be obtained by calling adoLastError()