Exemple #1
0
        internal bool SQLGetFunctions(ODBC32.SQL_API odbcFunction)
        {
            //SQLGetFunctions
            ODBC32.RetCode retcode;
            short          fExists;

            Debug.Assert((short)odbcFunction != 0, "SQL_API_ALL_FUNCTIONS is not supported");
            OdbcConnectionHandle connectionHandle = ConnectionHandle;

            if (null != connectionHandle)
            {
                retcode = connectionHandle.GetFunctions(odbcFunction, out fExists);
            }
            else
            {
                Debug.Fail("GetFunctions called and ConnectionHandle is null (connection is disposed?)");
                throw ODBC.ConnectionClosed();
            }

            if (retcode != ODBC32.RetCode.SUCCESS)
            {
                this.HandleError(connectionHandle, retcode);
            }

            if (fExists == 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemple #2
0
        internal bool SQLGetFunctions(ODBC32.SQL_API odbcFunction)
        {
            short num;
            OdbcConnectionHandle connectionHandle = this.ConnectionHandle;

            if (connectionHandle == null)
            {
                throw ADP.InvalidOperation("what is the right exception to throw here?");
            }
            ODBC32.RetCode functions = connectionHandle.GetFunctions(odbcFunction, out num);
            if (functions != ODBC32.RetCode.SUCCESS)
            {
                this.HandleError(connectionHandle, functions);
            }
            if (num == 0)
            {
                return(false);
            }
            return(true);
        }