func (conn *Connection) Close() *ODBCError { if conn.connected { ret := C.SQLDisconnect(C.SQLHDBC(conn.Dbc)) if !Success(ret) { err := FormatError(C.SQL_HANDLE_DBC, conn.Dbc) return err } ret = C.SQLFreeHandle(C.SQL_HANDLE_DBC, conn.Dbc) if !Success(ret) { err := FormatError(C.SQL_HANDLE_DBC, conn.Dbc) return err } conn.connected = false } return nil }
func SQLDisconnect(connectionHandle SQLHDBC) (ret SQLRETURN) { r := C.SQLDisconnect(C.SQLHDBC(connectionHandle)) return SQLRETURN(r) }