pub struct SQLHENV<V: OdbcVersion = SQL_OV_ODBC3_80> { /* private fields */ }Expand description
An environment is a global context which holds information such as:
- The environment’s state
- The current environment-level diagnostics
- The handles of connections currently allocated on the environment
- The current settings of each environment attribute
Environment handle is always used in calls to SQLDataSources and SQLDrivers and sometimes in calls to SQLAllocHandle, SQLEndTran, SQLFreeHandle, SQLGetDiagField, and SQLGetDiagRec.
§Documentation
https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/environment-handles
Implementations§
Source§impl<V: OdbcVersion> SQLHENV<V>
impl<V: OdbcVersion> SQLHENV<V>
Sourcepub fn SQLDataSourcesA(
&self,
Direction: SQLUSMALLINT,
ServerName: &mut OdbcStr<MaybeUninit<SQLCHAR>>,
NameLength1Ptr: &mut impl AsMutPtr<SQLSMALLINT>,
Description: &mut OdbcStr<MaybeUninit<SQLCHAR>>,
NameLength2Ptr: &mut impl AsMutPtr<SQLSMALLINT>,
) -> SQLRETURN
pub fn SQLDataSourcesA( &self, Direction: SQLUSMALLINT, ServerName: &mut OdbcStr<MaybeUninit<SQLCHAR>>, NameLength1Ptr: &mut impl AsMutPtr<SQLSMALLINT>, Description: &mut OdbcStr<MaybeUninit<SQLCHAR>>, NameLength2Ptr: &mut impl AsMutPtr<SQLSMALLINT>, ) -> SQLRETURN
Returns information about a data source. This function is implemented only by the Driver Manager.
For complete documentation on SQLDataSourcesA, see API reference.
§Returns
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.
Sourcepub fn SQLDataSourcesW(
&self,
Direction: SQLUSMALLINT,
ServerName: &mut OdbcStr<MaybeUninit<SQLWCHAR>>,
NameLength1Ptr: &mut impl AsMutPtr<SQLSMALLINT>,
Description: &mut OdbcStr<MaybeUninit<SQLWCHAR>>,
NameLength2Ptr: &mut impl AsMutPtr<SQLSMALLINT>,
) -> SQLRETURN
pub fn SQLDataSourcesW( &self, Direction: SQLUSMALLINT, ServerName: &mut OdbcStr<MaybeUninit<SQLWCHAR>>, NameLength1Ptr: &mut impl AsMutPtr<SQLSMALLINT>, Description: &mut OdbcStr<MaybeUninit<SQLWCHAR>>, NameLength2Ptr: &mut impl AsMutPtr<SQLSMALLINT>, ) -> SQLRETURN
Returns information about a data source. This function is implemented only by the Driver Manager.
For complete documentation on SQLDataSourcesW, see API reference.
§Returns
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.
Sourcepub fn SQLDriversA(
&self,
Direction: SQLUSMALLINT,
DriverDescription: &mut OdbcStr<MaybeUninit<SQLCHAR>>,
DescriptionLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>,
DriverAttributes: &mut OdbcStr<MaybeUninit<SQLCHAR>>,
AttributesLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>,
) -> SQLRETURN
pub fn SQLDriversA( &self, Direction: SQLUSMALLINT, DriverDescription: &mut OdbcStr<MaybeUninit<SQLCHAR>>, DescriptionLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>, DriverAttributes: &mut OdbcStr<MaybeUninit<SQLCHAR>>, AttributesLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>, ) -> SQLRETURN
Lists driver descriptions and driver attribute keywords. This function is implemented only by the Driver Manager.
For complete documentation on SQLDriversA, see API reference.
§Returns
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.
Sourcepub fn SQLDriversW(
&self,
Direction: SQLUSMALLINT,
DriverDescription: &mut OdbcStr<MaybeUninit<SQLWCHAR>>,
DescriptionLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>,
DriverAttributes: &mut OdbcStr<MaybeUninit<SQLWCHAR>>,
AttributesLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>,
) -> SQLRETURN
pub fn SQLDriversW( &self, Direction: SQLUSMALLINT, DriverDescription: &mut OdbcStr<MaybeUninit<SQLWCHAR>>, DescriptionLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>, DriverAttributes: &mut OdbcStr<MaybeUninit<SQLWCHAR>>, AttributesLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>, ) -> SQLRETURN
Lists driver descriptions and driver attribute keywords. This function is implemented only by the Driver Manager.
For complete documentation on SQLDriversW, see API reference.
§Returns
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.
Sourcepub fn SQLGetEnvAttr<A: Ident<Type = SQLINTEGER>, T>(
&self,
Attribute: A,
ValuePtr: Option<&mut T>,
StringLengthPtr: Option<&mut MaybeUninit<T::StrLen>>,
) -> SQLRETURN
pub fn SQLGetEnvAttr<A: Ident<Type = SQLINTEGER>, T>( &self, Attribute: A, ValuePtr: Option<&mut T>, StringLengthPtr: Option<&mut MaybeUninit<T::StrLen>>, ) -> SQLRETURN
Returns the current setting of an environment attribute.
For complete documentation on SQLGetEnvAttr, see API reference.
§Returns
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.
Sourcepub fn SQLSetEnvAttr<A: Ident<Type = SQLINTEGER>, T>(
&mut self,
Attribute: A,
ValuePtr: T,
) -> SQLRETURN
pub fn SQLSetEnvAttr<A: Ident<Type = SQLINTEGER>, T>( &mut self, Attribute: A, ValuePtr: T, ) -> SQLRETURN
Sets attributes that govern aspects of environments.
For complete documentation on SQLSetEnvAttr, see API reference.
§Returns
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or SQL_INVALID_HANDLE.