Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.16 Contents of RWDBEnvironmentHandle

The access library for the Microsoft SQL Server returns an environment handle that has the type RWDBMsSqlLibEnvironmentHandle. This handle provides methods that an application can use to set or retrieve certain connect time and configuration parameters.

Please note that some connect time parameters are set only when a connection is established with the SQL server. When the method returns a valid RWDBStatus for these parameters, it does not necessarily mean that the connection parameter has been accepted by the server. Appropriate error messages will be fielded to the application only when a connection is established.

Section 2.16.1 through Section 2.16.14 describe the contents of the RWDBMsSqlLibEnvironmentHandle class. Section 2.16.15 describes how to use the class.

2.16.1 Login Timeout

The loginTimeout() method defines the length of time in seconds that Microsoft SQL Server ODBC driver waits for a login response when making a connection attempt. Two methods are provided:

In the Microsoft SQL Server library manual, the default value is 60 seconds.

2.16.2 Timeout

The timeout() method defines the length of time in seconds that Microsoft SQL Server ODBC driver waits for a server response when making a request. Two methods are available:

In the Microsoft SQL Server library manual, the default is an infinite timeout period. The application can set this value at any time. It takes effect for all open connections immediately upon being called.

2.16.3 Access Mode

The accessMode method tells the driver whether it must support SQL statements that cause updates to occur. Two accessMode functions are available:

It can be set to either SQL_MODE_READ_ONLY or SQL_MODE_READ_WRITE, which is the default.

2.16.4 Trace Option

The traceOption method tells the driver manager whether to perform tracing. Two methods are available:

You can set the option as follows:

When tracing is on, the driver manager writes each ODBC function call to the trace file; Section 2.16.5 explains how to specify a trace file name. Tracing is enabled if the Trace keyword in the [ODBC] section of the ODBC.INI file (or registry) is set to 1 when an application gets an RWDBMsSqlLibEnvironmentHandle. If you need complete control of tracing capabilities through class RWDBMsSqlLibEnvironmentHandle, you must disable the trace in the ODBC.INI file (or registry).

2.16.5 Trace File Name

Use the traceFileName method to specify a trace file name. Two methods are defined:

The trace file name is an RWCString containing the name of the trace file. If tracing is not enabled, this file name is ignored. If tracing is enabled, the driver writes to this file each time a driver call is made. If no trace file is specified and tracing is enabled, the driver manager writes to SQL.LOG.

2.16.6 Current Qualifier

The currentQualifier method specifies the name of the qualifier to be used by the data source. Two methods are defined:

The qualifier can be either a database or a directory name. If the qualifier is a database, the driver sends a USE database statement to the data source. If the qualifier is a directory, the driver changes its current directory to the directory specified by qualifier.

2.16.7 Max Blob Size

The maxBlobSize method sets the maximum size for blobs that can be read by a scrolling RWDBCursor. Two methods are defined:

Maximum blob size can be set explicitly if using a scrolling RWDBCursor with an RWDBBlob. See Section 2.5, "Cursors." Sequential cursors are not restricted.

2.16.8 Max String Size

The maxStringSize method sets the maximum size for strings that can be read by a scrolling RWDBCursor. Two methods are defined:

Maximum string size can be set explicitly if using a scrolling RWDBCursor with a large string. See Section 2.5, "Cursors." Sequential cursors are not restricted.

2.16.9 National Language

The nationalLanguage() method defines the national language to use. Two methods are available:

In Microsoft SQL Server, national language is set for a particular connection using the SQLDriverConnect() connection string keyword LANGUAGE. For this setting to take effect, it must be called before an RWDBConnection is obtained. Please refer to the Microsoft SQL Server ODBC driver documentation for the semantics of setting the national language.

2.16.10 Application Name

The applicationName() method defines the application name that gets passed to the SQLDriverConnect() method when an RWDBConnection is obtained. Two methods are available:

To take effect, the method must be called before the RWDBConnection is obtained. Please refer to the Microsoft SQL Server ODBC driver documentation for the semantics of setting an application name.

2.16.11 Host Name

The hostName method defines the host name that gets passed to the SQLDriverConnect() method when an RWDBConnection is obtained. Two methods are available:

To take effect, the method must be called before the RWDBConnection is obtained. Please refer to the Microsoft SQL Server ODBC driver documentation for the semantics of setting host names.

2.16.12 Packet Size

The packetSize method defines the TDS packet size that gets set when an RWDBConnection is obtained. Two methods are available:

To take effect, the method must be called before the RWDBConnection is obtained. Please refer to the Microsoft SQL Server ODBC driver documentation for the semantics of setting TDS packet sizes.

2.16.13 Secure Login

RWDBMsSqlLibEnvironmentHandle includes the secureLogin method, which allows Windows NT users to use SQL Server's secure login feature. Enabling secureLogin tells SQL Server to use the user's NT login to establish a connection. The user and password fields supplied to RWDBManager::database() will be ignored. Two methods are provided:

2.16.14 Foreign Keys from Views

The access library for Microsoft SQL Server has not implemented the virtual functions:

Both functions are therefore no-ops which return false.

2.16.15 Using RWDBMsSqlLibEnvironmentHandle

The following example shows how to gain access to class RWDBMsSqlLibEnvironmentHandle. Note that the application must be compiled with an include path to the Microsoft SQL Server library include files.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.