using System; // ReSharper disable InconsistentNaming namespace System.Data.Jet { /// /// Jet configuration /// public static class JetConfiguration { /// /// The time span offset (Jet does not support timespans) /// public static DateTime TimeSpanOffset = new DateTime(1899, 12, 30); private static object _integerNullValue = Int32.MinValue; /// /// Gets or sets the integer null value returned by queries. This should solve a Jet issue /// that if I do a UNION ALL of null, int and null the Jet raises an error /// /// /// The integer null value. /// public static object IntegerNullValue { get { return _integerNullValue; } set { if (!(value is int) && value != null) throw new ArgumentOutOfRangeException("value", "IntegerNullValue should be an int or null"); _integerNullValue = value; } } public static string OleDbDefaultProvider = "Microsoft.ACE.OLEDB.15.0"; // The SQL statement // // (SELECT COUNT(*) FROM MSysRelationships) // // is a DUAL table simulation in Access databases // It must be a single line table. // If user cannot gain access to MSysRelationships table he can create a table with 1 record // and change DUAL static property. // I.e. create table dual with one and only one record // // CREATE TABLE Dual (id COUNTER CONSTRAINT pkey PRIMARY KEY) // INSERT INTO Dual (id) VALUES (1) // ALTER TABLE Dual ADD CONSTRAINT DualTableConstraint CHECK ((SELECT Count(*) FROM Dual) = 1) // // then change the DUAL property // // JetConfiguration.DUAL = "Dual"; // // For more information see also https://en.wikipedia.org/wiki/DUAL_table /// /// The DUAL table or query /// public static string DUAL = DUALForAccdb; /// /// The dual table for accdb /// public const string DUALForMdb = "(SELECT COUNT(*) FROM MSysRelationships)"; /// /// The dual table for accdb /// public const string DUALForAccdb = "(SELECT COUNT(*) FROM MSysAccessStorage)"; /// /// Gets or sets a value indicating whether show SQL statements. /// /// /// true to show SQL statements; otherwise, false. /// public static bool ShowSqlStatements = false; /// /// Gets or sets a value indicating whether the connection pooling should be used /// /// /// true to use the connection pooling; otherwise, false. /// public static bool UseConnectionPooling = false; } }