예제 #1
0
        internal void GetLiteralQuotes(string method, out string quotePrefix, out string quoteSuffix)
        {
            CheckStateOpen(method);
            OleDbConnectionPoolGroupProviderInfo info = ProviderInfo;

            if (info.HasQuoteFix)
            {
                quotePrefix = info.QuotePrefix;
                quoteSuffix = info.QuoteSuffix;
            }
            else
            {
                OleDbConnectionInternal connection = GetOpenConnection();
                quotePrefix = connection.GetLiteralInfo(ODB.DBLITERAL_QUOTE_PREFIX);
                quoteSuffix = connection.GetLiteralInfo(ODB.DBLITERAL_QUOTE_SUFFIX);
                if (null == quotePrefix)
                {
                    quotePrefix = "";
                }
                if (null == quoteSuffix)
                {
                    quoteSuffix = quotePrefix;
                }
                info.SetQuoteFix(quotePrefix, quoteSuffix);
            }
        }
예제 #2
0
        internal void GetLiteralQuotes(string method, out string quotePrefix, out string quoteSuffix)
        {
            this.CheckStateOpen(method);
            OleDbConnectionPoolGroupProviderInfo providerInfo = this.ProviderInfo;

            if (providerInfo.HasQuoteFix)
            {
                quotePrefix = providerInfo.QuotePrefix;
                quoteSuffix = providerInfo.QuoteSuffix;
            }
            else
            {
                OleDbConnectionInternal openConnection = this.GetOpenConnection();
                quotePrefix = openConnection.GetLiteralInfo(15);
                quoteSuffix = openConnection.GetLiteralInfo(0x1c);
                if (quotePrefix == null)
                {
                    quotePrefix = "";
                }
                if (quoteSuffix == null)
                {
                    quoteSuffix = quotePrefix;
                }
                providerInfo.SetQuoteFix(quotePrefix, quoteSuffix);
            }
        }
예제 #3
0
        private DataTable GetDataSourceInformationTable(OleDbConnection connection, OleDbConnectionInternal internalConnection)
        {
            // verify that the data source information table is in the data set
            DataTable dataSourceInformationTable = CollectionDataSet.Tables[DbMetaDataCollectionNames.DataSourceInformation];

            if (dataSourceInformationTable == null)
            {
                throw ADP.UnableToBuildCollection(DbMetaDataCollectionNames.DataSourceInformation);
            }

            // copy the table filtering out any rows that don't apply to tho current version of the prrovider
            dataSourceInformationTable = CloneAndFilterCollection(DbMetaDataCollectionNames.DataSourceInformation, null);

            // after filtering there better be just one row
            if (dataSourceInformationTable.Rows.Count != 1)
            {
                throw ADP.IncorrectNumberOfDataSourceInformationRows();
            }
            DataRow dataSourceInformation = dataSourceInformationTable.Rows[0];

            // update the identifier separator
            string catalogSeparatorPattern = internalConnection.GetLiteralInfo(ODB.DBLITERAL_CATALOG_SEPARATOR);
            string schemaSeparatorPattern  = internalConnection.GetLiteralInfo(ODB.DBLITERAL_SCHEMA_SEPARATOR);

            if (catalogSeparatorPattern != null)
            {
                StringBuilder compositeSeparatorPattern = new StringBuilder();
                StringBuilder patternEscaped            = new StringBuilder();
                ADP.EscapeSpecialCharacters(catalogSeparatorPattern, patternEscaped);
                compositeSeparatorPattern.Append(patternEscaped.ToString());
                if ((schemaSeparatorPattern != null) && (schemaSeparatorPattern != catalogSeparatorPattern))
                {
                    compositeSeparatorPattern.Append("|");
                    patternEscaped.Length = 0;
                    ADP.EscapeSpecialCharacters(schemaSeparatorPattern, patternEscaped);
                    compositeSeparatorPattern.Append(patternEscaped.ToString());
                }
                dataSourceInformation[DbMetaDataColumnNames.CompositeIdentifierSeparatorPattern] = compositeSeparatorPattern.ToString();
            }
            else if (schemaSeparatorPattern != null)
            {
                StringBuilder patternEscaped = new StringBuilder();
                ADP.EscapeSpecialCharacters(schemaSeparatorPattern, patternEscaped);
                dataSourceInformation[DbMetaDataColumnNames.CompositeIdentifierSeparatorPattern] = patternEscaped.ToString();
                ;
            }

            // update the DataSourceProductName
            object property;

            property = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo, ODB.DBPROP_DBMSNAME);
            if (property != null)
            {
                dataSourceInformation[DbMetaDataColumnNames.DataSourceProductName] = (string)property;
            }

            // update the server version strings
            dataSourceInformation[DbMetaDataColumnNames.DataSourceProductVersion]           = ServerVersion;
            dataSourceInformation[DbMetaDataColumnNames.DataSourceProductVersionNormalized] = ServerVersionNormalized;

            // values that are the same for all OLE DB Providers.
            dataSourceInformation[DbMetaDataColumnNames.ParameterMarkerFormat]  = "?";
            dataSourceInformation[DbMetaDataColumnNames.ParameterMarkerPattern] = "\\?";
            dataSourceInformation[DbMetaDataColumnNames.ParameterNameMaxLength] = 0;

            property = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo, ODB.DBPROP_GROUPBY);
            GroupByBehavior groupByBehavior = GroupByBehavior.Unknown;

            if (property != null)
            {
                switch ((int)property)
                {
                case ODB.DBPROPVAL_GB_CONTAINS_SELECT:
                    groupByBehavior = GroupByBehavior.MustContainAll;
                    break;

                case ODB.DBPROPVAL_GB_EQUALS_SELECT:
                    groupByBehavior = GroupByBehavior.ExactMatch;
                    break;

                case ODB.DBPROPVAL_GB_NO_RELATION:
                    groupByBehavior = GroupByBehavior.Unrelated;
                    break;

                case ODB.DBPROPVAL_GB_NOT_SUPPORTED:
                    groupByBehavior = GroupByBehavior.NotSupported;
                    break;
                }
            }
            dataSourceInformation[DbMetaDataColumnNames.GroupByBehavior] = groupByBehavior;

            SetIdentifierCase(DbMetaDataColumnNames.IdentifierCase, ODB.DBPROP_IDENTIFIERCASE, dataSourceInformation, connection);
            SetIdentifierCase(DbMetaDataColumnNames.QuotedIdentifierCase, ODB.DBPROP_QUOTEDIDENTIFIERCASE, dataSourceInformation, connection);

            property = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo, ODB.DBPROP_ORDERBYCOLUNSINSELECT);
            if (property != null)
            {
                dataSourceInformation[DbMetaDataColumnNames.OrderByColumnsInSelect] = (bool)property;
            }

            DataTable infoLiterals = internalConnection.BuildInfoLiterals();

            if (infoLiterals != null)
            {
                DataRow[] tableNameRow = infoLiterals.Select("Literal = " + ODB.DBLITERAL_TABLE_NAME.ToString(CultureInfo.InvariantCulture));
                if (tableNameRow != null)
                {
                    object invalidCharsObject = tableNameRow[0]["InvalidChars"];
                    if (invalidCharsObject.GetType() == typeof(string))
                    {
                        string invalidChars = (string)invalidCharsObject;
                        object invalidStartingCharsObject = tableNameRow[0]["InvalidStartingChars"];
                        string invalidStartingChars;
                        if (invalidStartingCharsObject.GetType() == typeof(string))
                        {
                            invalidStartingChars = (string)invalidStartingCharsObject;
                        }
                        else
                        {
                            invalidStartingChars = invalidChars;
                        }
                        dataSourceInformation[DbMetaDataColumnNames.IdentifierPattern] =
                            BuildRegularExpression(invalidChars, invalidStartingChars);
                    }
                }
            }

            // build the QuotedIdentifierPattern using the quote prefix and suffix from the provider and
            // assuming that the quote suffix is escaped via repetion (i.e " becomes "")
            string quotePrefix;
            string quoteSuffix;

            connection.GetLiteralQuotes(ADP.GetSchema, out quotePrefix, out quoteSuffix);

            if (quotePrefix != null)
            {
                // if the quote suffix is null assume that it is the same as the prefix (See OLEDB spec
                // IDBInfo::GetLiteralInfo DBLITERAL_QUOTE_SUFFIX.)
                if (quoteSuffix == null)
                {
                    quoteSuffix = quotePrefix;
                }

                // only know how to build the parttern if the suffix is 1 character
                // in all other cases just leave the field null
                if (quoteSuffix.Length == 1)
                {
                    StringBuilder scratchStringBuilder = new StringBuilder();
                    ADP.EscapeSpecialCharacters(quoteSuffix, scratchStringBuilder);
                    string escapedQuoteSuffixString = scratchStringBuilder.ToString();
                    scratchStringBuilder.Length = 0;

                    ADP.EscapeSpecialCharacters(quotePrefix, scratchStringBuilder);
                    scratchStringBuilder.Append("(([^");
                    scratchStringBuilder.Append(escapedQuoteSuffixString);
                    scratchStringBuilder.Append("]|");
                    scratchStringBuilder.Append(escapedQuoteSuffixString);
                    scratchStringBuilder.Append(escapedQuoteSuffixString);
                    scratchStringBuilder.Append(")*)");
                    scratchStringBuilder.Append(escapedQuoteSuffixString);
                    dataSourceInformation[DbMetaDataColumnNames.QuotedIdentifierPattern] = scratchStringBuilder.ToString();
                }
            }

            dataSourceInformationTable.AcceptChanges();

            return(dataSourceInformationTable);
        }
        private DataTable GetDataSourceInformationTable(OleDbConnection connection, OleDbConnectionInternal internalConnection)
        {
            string str3;
            string str4;
            if (base.CollectionDataSet.Tables[DbMetaDataCollectionNames.DataSourceInformation] == null)
            {
                throw ADP.UnableToBuildCollection(DbMetaDataCollectionNames.DataSourceInformation);
            }
            DataTable table = base.CloneAndFilterCollection(DbMetaDataCollectionNames.DataSourceInformation, null);
            if (table.Rows.Count != 1)
            {
                throw ADP.IncorrectNumberOfDataSourceInformationRows();
            }
            DataRow row = table.Rows[0];
            string literalInfo = internalConnection.GetLiteralInfo(3);
            string unescapedString = internalConnection.GetLiteralInfo(0x1b);
            if (literalInfo != null)
            {
                StringBuilder builder3 = new StringBuilder();
                StringBuilder escapedString = new StringBuilder();
                ADP.EscapeSpecialCharacters(literalInfo, escapedString);
                builder3.Append(escapedString.ToString());
                if ((unescapedString != null) && (unescapedString != literalInfo))
                {
                    builder3.Append("|");
                    escapedString.Length = 0;
                    ADP.EscapeSpecialCharacters(unescapedString, escapedString);
                    builder3.Append(escapedString.ToString());
                }
                row[DbMetaDataColumnNames.CompositeIdentifierSeparatorPattern] = builder3.ToString();
            }
            else if (unescapedString != null)
            {
                StringBuilder builder4 = new StringBuilder();
                ADP.EscapeSpecialCharacters(unescapedString, builder4);
                row[DbMetaDataColumnNames.CompositeIdentifierSeparatorPattern] = builder4.ToString();
            }
            object dataSourcePropertyValue = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo, 40);
            if (dataSourcePropertyValue != null)
            {
                row[DbMetaDataColumnNames.DataSourceProductName] = (string) dataSourcePropertyValue;
            }
            row[DbMetaDataColumnNames.DataSourceProductVersion] = base.ServerVersion;
            row[DbMetaDataColumnNames.DataSourceProductVersionNormalized] = base.ServerVersionNormalized;
            row[DbMetaDataColumnNames.ParameterMarkerFormat] = "?";
            row[DbMetaDataColumnNames.ParameterMarkerPattern] = @"\?";
            row[DbMetaDataColumnNames.ParameterNameMaxLength] = 0;
            dataSourcePropertyValue = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo, 0x2c);
            GroupByBehavior unknown = GroupByBehavior.Unknown;
            if (dataSourcePropertyValue != null)
            {
                switch (((int) dataSourcePropertyValue))
                {
                    case 1:
                        unknown = GroupByBehavior.NotSupported;
                        break;

                    case 2:
                        unknown = GroupByBehavior.ExactMatch;
                        break;

                    case 4:
                        unknown = GroupByBehavior.MustContainAll;
                        break;

                    case 8:
                        unknown = GroupByBehavior.Unrelated;
                        break;
                }
            }
            row[DbMetaDataColumnNames.GroupByBehavior] = unknown;
            this.SetIdentifierCase(DbMetaDataColumnNames.IdentifierCase, 0x2e, row, connection);
            this.SetIdentifierCase(DbMetaDataColumnNames.QuotedIdentifierCase, 100, row, connection);
            dataSourcePropertyValue = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo, 0x55);
            if (dataSourcePropertyValue != null)
            {
                row[DbMetaDataColumnNames.OrderByColumnsInSelect] = (bool) dataSourcePropertyValue;
            }
            DataTable table2 = internalConnection.BuildInfoLiterals();
            if (table2 != null)
            {
                DataRow[] rowArray = table2.Select("Literal = " + 0x11.ToString(CultureInfo.InvariantCulture));
                if (rowArray != null)
                {
                    object obj4 = rowArray[0]["InvalidChars"];
                    if (obj4.GetType() == typeof(string))
                    {
                        string str6;
                        string invalidChars = (string) obj4;
                        object obj3 = rowArray[0]["InvalidStartingChars"];
                        if (obj3.GetType() == typeof(string))
                        {
                            str6 = (string) obj3;
                        }
                        else
                        {
                            str6 = invalidChars;
                        }
                        row[DbMetaDataColumnNames.IdentifierPattern] = this.BuildRegularExpression(invalidChars, str6);
                    }
                }
            }
            connection.GetLiteralQuotes("GetSchema", out str4, out str3);
            if (str4 != null)
            {
                if (str3 == null)
                {
                    str3 = str4;
                }
                if (str3.Length == 1)
                {
                    StringBuilder builder = new StringBuilder();
                    ADP.EscapeSpecialCharacters(str3, builder);
                    string str2 = builder.ToString();
                    builder.Length = 0;
                    ADP.EscapeSpecialCharacters(str4, builder);
                    builder.Append("(([^");
                    builder.Append(str2);
                    builder.Append("]|");
                    builder.Append(str2);
                    builder.Append(str2);
                    builder.Append(")*)");
                    builder.Append(str2);
                    row[DbMetaDataColumnNames.QuotedIdentifierPattern] = builder.ToString();
                }
            }
            table.AcceptChanges();
            return table;
        }
        private DataTable GetDataSourceInformationTable(OleDbConnection connection, OleDbConnectionInternal internalConnection)
        {
            string str3;
            string str4;

            if (base.CollectionDataSet.Tables[DbMetaDataCollectionNames.DataSourceInformation] == null)
            {
                throw ADP.UnableToBuildCollection(DbMetaDataCollectionNames.DataSourceInformation);
            }
            DataTable table = base.CloneAndFilterCollection(DbMetaDataCollectionNames.DataSourceInformation, null);

            if (table.Rows.Count != 1)
            {
                throw ADP.IncorrectNumberOfDataSourceInformationRows();
            }
            DataRow row             = table.Rows[0];
            string  literalInfo     = internalConnection.GetLiteralInfo(3);
            string  unescapedString = internalConnection.GetLiteralInfo(0x1b);

            if (literalInfo != null)
            {
                StringBuilder builder3      = new StringBuilder();
                StringBuilder escapedString = new StringBuilder();
                ADP.EscapeSpecialCharacters(literalInfo, escapedString);
                builder3.Append(escapedString.ToString());
                if ((unescapedString != null) && (unescapedString != literalInfo))
                {
                    builder3.Append("|");
                    escapedString.Length = 0;
                    ADP.EscapeSpecialCharacters(unescapedString, escapedString);
                    builder3.Append(escapedString.ToString());
                }
                row[DbMetaDataColumnNames.CompositeIdentifierSeparatorPattern] = builder3.ToString();
            }
            else if (unescapedString != null)
            {
                StringBuilder builder4 = new StringBuilder();
                ADP.EscapeSpecialCharacters(unescapedString, builder4);
                row[DbMetaDataColumnNames.CompositeIdentifierSeparatorPattern] = builder4.ToString();
            }
            object dataSourcePropertyValue = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo, 40);

            if (dataSourcePropertyValue != null)
            {
                row[DbMetaDataColumnNames.DataSourceProductName] = (string)dataSourcePropertyValue;
            }
            row[DbMetaDataColumnNames.DataSourceProductVersion]           = base.ServerVersion;
            row[DbMetaDataColumnNames.DataSourceProductVersionNormalized] = base.ServerVersionNormalized;
            row[DbMetaDataColumnNames.ParameterMarkerFormat]  = "?";
            row[DbMetaDataColumnNames.ParameterMarkerPattern] = @"\?";
            row[DbMetaDataColumnNames.ParameterNameMaxLength] = 0;
            dataSourcePropertyValue = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo, 0x2c);
            GroupByBehavior unknown = GroupByBehavior.Unknown;

            if (dataSourcePropertyValue != null)
            {
                switch (((int)dataSourcePropertyValue))
                {
                case 1:
                    unknown = GroupByBehavior.NotSupported;
                    break;

                case 2:
                    unknown = GroupByBehavior.ExactMatch;
                    break;

                case 4:
                    unknown = GroupByBehavior.MustContainAll;
                    break;

                case 8:
                    unknown = GroupByBehavior.Unrelated;
                    break;
                }
            }
            row[DbMetaDataColumnNames.GroupByBehavior] = unknown;
            this.SetIdentifierCase(DbMetaDataColumnNames.IdentifierCase, 0x2e, row, connection);
            this.SetIdentifierCase(DbMetaDataColumnNames.QuotedIdentifierCase, 100, row, connection);
            dataSourcePropertyValue = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo, 0x55);
            if (dataSourcePropertyValue != null)
            {
                row[DbMetaDataColumnNames.OrderByColumnsInSelect] = (bool)dataSourcePropertyValue;
            }
            DataTable table2 = internalConnection.BuildInfoLiterals();

            if (table2 != null)
            {
                DataRow[] rowArray = table2.Select("Literal = " + 0x11.ToString(CultureInfo.InvariantCulture));
                if (rowArray != null)
                {
                    object obj4 = rowArray[0]["InvalidChars"];
                    if (obj4.GetType() == typeof(string))
                    {
                        string str6;
                        string invalidChars = (string)obj4;
                        object obj3         = rowArray[0]["InvalidStartingChars"];
                        if (obj3.GetType() == typeof(string))
                        {
                            str6 = (string)obj3;
                        }
                        else
                        {
                            str6 = invalidChars;
                        }
                        row[DbMetaDataColumnNames.IdentifierPattern] = this.BuildRegularExpression(invalidChars, str6);
                    }
                }
            }
            connection.GetLiteralQuotes("GetSchema", out str4, out str3);
            if (str4 != null)
            {
                if (str3 == null)
                {
                    str3 = str4;
                }
                if (str3.Length == 1)
                {
                    StringBuilder builder = new StringBuilder();
                    ADP.EscapeSpecialCharacters(str3, builder);
                    string str2 = builder.ToString();
                    builder.Length = 0;
                    ADP.EscapeSpecialCharacters(str4, builder);
                    builder.Append("(([^");
                    builder.Append(str2);
                    builder.Append("]|");
                    builder.Append(str2);
                    builder.Append(str2);
                    builder.Append(")*)");
                    builder.Append(str2);
                    row[DbMetaDataColumnNames.QuotedIdentifierPattern] = builder.ToString();
                }
            }
            table.AcceptChanges();
            return(table);
        }
예제 #6
0
        private DataTable GetDataSourceInformationTable(OleDbConnection connection, OleDbConnectionInternal internalConnection){

            // verify that the data source information table is in the data set
            DataTable dataSourceInformationTable = CollectionDataSet.Tables[DbMetaDataCollectionNames.DataSourceInformation];
            if (dataSourceInformationTable == null){
                throw ADP.UnableToBuildCollection(DbMetaDataCollectionNames.DataSourceInformation);
            }

            // copy the table filtering out any rows that don't apply to tho current version of the prrovider
            dataSourceInformationTable = CloneAndFilterCollection(DbMetaDataCollectionNames.DataSourceInformation, null);

            // after filtering there better be just one row
            if (dataSourceInformationTable.Rows.Count != 1){
                throw ADP.IncorrectNumberOfDataSourceInformationRows();
            }
            DataRow dataSourceInformation = dataSourceInformationTable.Rows[0];

            // update the identifier separator
            string catalogSeparatorPattern = internalConnection.GetLiteralInfo(ODB.DBLITERAL_CATALOG_SEPARATOR);
            string schemaSeparatorPattern = internalConnection.GetLiteralInfo(ODB.DBLITERAL_SCHEMA_SEPARATOR);

            if (catalogSeparatorPattern != null) {
                StringBuilder compositeSeparatorPattern = new StringBuilder();
                StringBuilder patternEscaped = new StringBuilder();
                ADP.EscapeSpecialCharacters(catalogSeparatorPattern,patternEscaped);
                compositeSeparatorPattern.Append(patternEscaped.ToString());
                if ((schemaSeparatorPattern != null) && (schemaSeparatorPattern != catalogSeparatorPattern)) {
                    compositeSeparatorPattern.Append("|");
                    patternEscaped.Length = 0;
                    ADP.EscapeSpecialCharacters(schemaSeparatorPattern,patternEscaped);
                    compositeSeparatorPattern.Append(patternEscaped.ToString());
                }
                    dataSourceInformation[DbMetaDataColumnNames.CompositeIdentifierSeparatorPattern] = compositeSeparatorPattern.ToString();
            }
            else if (schemaSeparatorPattern != null){
                StringBuilder patternEscaped = new StringBuilder();
                ADP.EscapeSpecialCharacters(schemaSeparatorPattern, patternEscaped);
                dataSourceInformation[DbMetaDataColumnNames.CompositeIdentifierSeparatorPattern] = patternEscaped.ToString();;
            }

            // update the DataSourceProductName
            object property;
            property = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo,ODB.DBPROP_DBMSNAME);
            if (property != null) {
                dataSourceInformation[DbMetaDataColumnNames.DataSourceProductName] = (string) property;
            }

            // update the server version strings
            dataSourceInformation[DbMetaDataColumnNames.DataSourceProductVersion] = ServerVersion;
            dataSourceInformation[DbMetaDataColumnNames.DataSourceProductVersionNormalized] = ServerVersionNormalized;


                // values that are the same for all OLE DB Providers. See SQLBU 308529
                dataSourceInformation[DbMetaDataColumnNames.ParameterMarkerFormat] =  "?";
                dataSourceInformation[DbMetaDataColumnNames.ParameterMarkerPattern] =  "\\?";
                dataSourceInformation[DbMetaDataColumnNames.ParameterNameMaxLength] = 0;


            property = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo,ODB.DBPROP_GROUPBY);
            GroupByBehavior groupByBehavior = GroupByBehavior.Unknown;
            if (property != null) {
                switch ((int)property) {

                    case ODB.DBPROPVAL_GB_CONTAINS_SELECT:
                        groupByBehavior = GroupByBehavior.MustContainAll;
                        break;

                    case ODB.DBPROPVAL_GB_EQUALS_SELECT:
                        groupByBehavior = GroupByBehavior.ExactMatch;
                        break;

                    case ODB.DBPROPVAL_GB_NO_RELATION:
                        groupByBehavior = GroupByBehavior.Unrelated;
                        break;

                    case ODB.DBPROPVAL_GB_NOT_SUPPORTED:
                        groupByBehavior = GroupByBehavior.NotSupported;
                        break;
                }
            }
            dataSourceInformation[DbMetaDataColumnNames.GroupByBehavior] = groupByBehavior;

            SetIdentifierCase(DbMetaDataColumnNames.IdentifierCase,ODB.DBPROP_IDENTIFIERCASE,dataSourceInformation, connection);
            SetIdentifierCase(DbMetaDataColumnNames.QuotedIdentifierCase,ODB.DBPROP_QUOTEDIDENTIFIERCASE,dataSourceInformation, connection);

            property = connection.GetDataSourcePropertyValue(OleDbPropertySetGuid.DataSourceInfo,ODB.DBPROP_ORDERBYCOLUNSINSELECT);
            if (property != null) {
                dataSourceInformation[DbMetaDataColumnNames.OrderByColumnsInSelect] = (bool) property;
            }

            DataTable infoLiterals = internalConnection.BuildInfoLiterals();
            if (infoLiterals != null){
                DataRow[] tableNameRow = infoLiterals.Select("Literal = " + ODB.DBLITERAL_TABLE_NAME.ToString(CultureInfo.InvariantCulture));
                if (tableNameRow != null) {
                    object invalidCharsObject = tableNameRow[0]["InvalidChars"];
                    if (invalidCharsObject.GetType() == typeof(string)) {
                        string invalidChars = (string)invalidCharsObject;
                        object invalidStartingCharsObject = tableNameRow[0]["InvalidStartingChars"];
                        string invalidStartingChars;
                        if (invalidStartingCharsObject.GetType() == typeof(string)) {
                            invalidStartingChars = (string)invalidStartingCharsObject;
                        }
                        else {
                            invalidStartingChars = invalidChars;
                        }
                        dataSourceInformation[DbMetaDataColumnNames.IdentifierPattern] =
                                                    BuildRegularExpression(invalidChars,invalidStartingChars);
                    }
                }
            }

            // build the QuotedIdentifierPattern using the quote prefix and suffix from the provider and
            // assuming that the quote suffix is escaped via repetion (i.e " becomes "")
            string quotePrefix;
            string quoteSuffix;
            connection.GetLiteralQuotes(ADP.GetSchema, out quotePrefix, out quoteSuffix);

            if (quotePrefix != null){

                // if the quote suffix is null assume that it is the same as the prefix (See OLEDB spec
                // IDBInfo::GetLiteralInfo DBLITERAL_QUOTE_SUFFIX.)
                if (quoteSuffix == null) {
                    quoteSuffix = quotePrefix;
                }

                // only know how to build the parttern if the suffix is 1 character
                // in all other cases just leave the field null
                if (quoteSuffix.Length == 1) {
                    StringBuilder scratchStringBuilder = new StringBuilder();
                    ADP.EscapeSpecialCharacters(quoteSuffix,scratchStringBuilder );
                    string escapedQuoteSuffixString = scratchStringBuilder.ToString();
                    scratchStringBuilder.Length = 0;

                    ADP.EscapeSpecialCharacters(quotePrefix, scratchStringBuilder);
                    scratchStringBuilder.Append("(([^");
                    scratchStringBuilder.Append(escapedQuoteSuffixString);
                    scratchStringBuilder.Append("]|");
                    scratchStringBuilder.Append(escapedQuoteSuffixString);
                    scratchStringBuilder.Append(escapedQuoteSuffixString);
                    scratchStringBuilder.Append(")*)");
                    scratchStringBuilder.Append(escapedQuoteSuffixString);
                    dataSourceInformation[DbMetaDataColumnNames.QuotedIdentifierPattern] = scratchStringBuilder.ToString();
                }
            }

            dataSourceInformationTable.AcceptChanges();

            return dataSourceInformationTable;
        }