@@ -13,6 +13,7 @@ public class AdoxSchema : SchemaProvider
13
13
private readonly dynamic _connection ;
14
14
private readonly dynamic _catalog ;
15
15
16
+ private bool _ignoreMsys ;
16
17
public AdoxSchema ( JetConnection connection , bool naturalOnly , bool readOnly )
17
18
: this ( connection , readOnly )
18
19
{
@@ -22,7 +23,7 @@ public AdoxSchema(JetConnection connection, bool naturalOnly, bool readOnly)
22
23
public AdoxSchema ( JetConnection connection , bool readOnly )
23
24
{
24
25
_connection = new ComObject ( "ADODB.Connection" ) ;
25
-
26
+ _ignoreMsys = connection . IgnoreMsys ;
26
27
try
27
28
{
28
29
var connectionString = GetOleDbConnectionString ( connection . ActiveConnectionString ) ;
@@ -105,6 +106,11 @@ public override DataTable GetTables()
105
106
106
107
var tableName = ( string ) table . Name ;
107
108
109
+ if ( tableName . StartsWith ( "MSys" , StringComparison . OrdinalIgnoreCase ) && _ignoreMsys )
110
+ {
111
+ continue ;
112
+ }
113
+
108
114
// Depending on the provider (ODBC or OLE DB) used, the Tables collection might contain VIEWs
109
115
// that take parameters, which makes them procedures.
110
116
// We make sure here, that we exclude any procedures from the returned table list.
@@ -202,6 +208,11 @@ public override DataTable GetColumns()
202
208
using var table = tables [ i ] ;
203
209
var tableName = ( string ) table . Name ;
204
210
211
+ if ( tableName . StartsWith ( "MSys" , StringComparison . OrdinalIgnoreCase ) && _ignoreMsys )
212
+ {
213
+ continue ;
214
+ }
215
+
205
216
using var columns = table . Columns ;
206
217
var columnCount = columns . Count ;
207
218
@@ -282,6 +293,11 @@ public override DataTable GetIndexes()
282
293
using var table = tables [ i ] ;
283
294
var tableName = ( string ) table . Name ;
284
295
296
+ if ( tableName . StartsWith ( "MSys" , StringComparison . OrdinalIgnoreCase ) && _ignoreMsys )
297
+ {
298
+ continue ;
299
+ }
300
+
285
301
using var indexes = table . Indexes ;
286
302
var indexCount = ( int ) indexes . Count ;
287
303
@@ -337,6 +353,11 @@ public override DataTable GetIndexColumns()
337
353
using var table = tables [ i ] ;
338
354
var tableName = ( string ) table . Name ;
339
355
356
+ if ( tableName . StartsWith ( "MSys" , StringComparison . OrdinalIgnoreCase ) && _ignoreMsys )
357
+ {
358
+ continue ;
359
+ }
360
+
340
361
using var indexes = table . Indexes ;
341
362
var indexCount = ( int ) indexes . Count ;
342
363
@@ -384,6 +405,11 @@ public override DataTable GetRelations()
384
405
using var table = tables [ i ] ;
385
406
var referencingTableName = ( string ) table . Name ;
386
407
408
+ if ( table . Name . StartsWith ( "MSys" , StringComparison . OrdinalIgnoreCase ) && _ignoreMsys )
409
+ {
410
+ continue ;
411
+ }
412
+
387
413
using var keys = table . Keys ;
388
414
var keyCount = ( int ) keys . Count ;
389
415
@@ -446,6 +472,11 @@ public override DataTable GetRelationColumns()
446
472
{
447
473
using var table = tables [ i ] ;
448
474
475
+ if ( table . Name . StartsWith ( "MSys" , StringComparison . OrdinalIgnoreCase ) && _ignoreMsys )
476
+ {
477
+ continue ;
478
+ }
479
+
449
480
using var keys = table . Keys ;
450
481
var keyCount = ( int ) keys . Count ;
451
482
0 commit comments