Пример #1
0
func initEnv() (err *ODBCError) {
	ret := C.SQLAllocHandle(C.SQL_HANDLE_ENV, nil, &Genv)
	if !Success(ret) {
		err := FormatError(C.SQL_HANDLE_ENV, Genv)
		return err
	}
	ret = C.SQLSetEnvAttr(C.SQLHENV(Genv), C.SQL_ATTR_ODBC_VERSION, C.SQLPOINTER(unsafe.Pointer(uintptr(C.SQL_OV_ODBC3))), C.SQLINTEGER(0))
	if !Success(ret) {
		err := FormatError(C.SQL_HANDLE_ENV, Genv)
		return err
	}
	return nil
}
Пример #2
0
func SQLSetEnvAttr(environmentHandle SQLHENV, attribute SQLINTEGER, valuePtr SQLPOINTER, stringLength SQLINTEGER) (ret SQLRETURN) {
	r := C.SQLSetEnvAttr(C.SQLHENV(environmentHandle), C.SQLINTEGER(attribute), C.SQLPOINTER(valuePtr), C.SQLINTEGER(stringLength))
	return SQLRETURN(r)
}
Пример #3
0
func SQLSetEnvUIntPtrAttr(environmentHandle SQLHENV, attribute SQLINTEGER, valuePtr uintptr, stringLength SQLINTEGER) (ret SQLRETURN) {
	r := C.sqlSetEnvUIntPtrAttr(C.SQLHENV(environmentHandle), C.SQLINTEGER(attribute), C.uintptr_t(valuePtr), C.SQLINTEGER(stringLength))
	return SQLRETURN(r)
}