private object GetDefaultValue(DataRow row, MsAccessColumnSchema column, TableSchema table)
        {
            object defaultValue       = null;
            string defaultValueString = null;

            if (row.IsNull(ColumnsSchemaNames.ColumnDefault))
            {
                defaultValue = column.AllowNull ? DBNull.Value : _defaultValueMapping[column.OleDbType];
            }
            else
            {
                defaultValueString = GetDefaultValueString(row.Field <string>(ColumnsSchemaNames.ColumnDefault));
                defaultValue       = GetDefaultValueFromString(defaultValueString, column.OleDbType);
            }

            MsAccessParseDefaultValueEventArgs e = new MsAccessParseDefaultValueEventArgs(
                table.Name, column.Name, column.OleDbType, defaultValueString, defaultValue);

            OnParseDefaultValue(e);
            if (e.Handled)
            {
                defaultValue = e.DefaultValue;
            }

            if ((defaultValue == null) || (defaultValue == DBNull.Value))
            {
                return(column.AllowNull ? DBNull.Value : _defaultValueMapping[column.OleDbType]);
            }
            return(defaultValue);
        }
        private MsAccessColumnSchema CreateColumnSchema(DataRow row, TableSchema table)
        {
            MsAccessColumnSchema column = new MsAccessColumnSchema(row.Field <string>(ColumnsSchemaNames.ColumnName));

            column.AllowNull    = row.Field <bool>(ColumnsSchemaNames.IsNullable);
            column.OleDbType    = GetOleDbType(row);
            column.DefaultValue = GetDefaultValue(row, column, table);
            if (!row.IsNull(ColumnsSchemaNames.CharacterMaximumLength))
            {
                column.Size = (int)row.Field <long>(ColumnsSchemaNames.CharacterMaximumLength);
            }

            return(column);
        }