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 }
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) }