@@ -9,9 +9,7 @@ namespace System.Data.OleDb.Tests
99 public static class Helpers
1010 {
1111 public const string IsDriverAvailable = nameof ( Helpers ) + "." + nameof ( GetIsDriverAvailable ) ;
12- public const string IsAceDriverAvailable = nameof ( Helpers ) + "." + nameof ( GetIsAceDriverAvailable ) ;
1312 public static bool GetIsDriverAvailable ( ) => Nested . IsAvailable ;
14- public static bool GetIsAceDriverAvailable ( ) => GetIsDriverAvailable ( ) && ! PlatformDetection . Is32BitProcess ;
1513 public static string ProviderName => Nested . ProviderName ;
1614 public static string GetTableName ( string memberName ) => memberName + ".csv" ;
1715
@@ -21,25 +19,34 @@ private class Nested
2119 public static readonly string ProviderName ;
2220 public static Nested Instance => s_instance ;
2321 private static readonly Nested s_instance = new Nested ( ) ;
24- private const string ExpectedProviderName = @"Microsoft.ACE.OLEDB.12.0" ;
2522 private Nested ( ) { }
2623 static Nested ( )
2724 {
2825 // Get the sources rowset for the SQLOLEDB enumerator
2926 DataTable table = ( new OleDbEnumerator ( ) ) . GetElements ( ) ;
3027 DataColumn providersRegistered = table . Columns [ "SOURCES_NAME" ] ;
31- List < object > providerNames = new List < object > ( ) ;
28+ List < string > providerNames = new List < object > ( ) ;
3229 foreach ( DataRow row in table . Rows )
3330 {
3431 providerNames . Add ( ( string ) row [ providersRegistered ] ) ;
3532 }
33+
3634 // skip if x86 or if the expected driver not available
37- IsAvailable = ! PlatformDetection . Is32BitProcess && providerNames . Contains ( ExpectedProviderName ) ;
35+ //IsAvailable = !PlatformDetection.Is32BitProcess && providerNames.Contains(ExpectedProviderName);
36+ // ActiveIssue: https://github.com/dotnet/runtime/issues/29969
3837 if ( ! CultureInfo . CurrentCulture . Name . Equals ( "en-US" , StringComparison . OrdinalIgnoreCase ) )
3938 {
40- IsAvailable = false ; // ActiveIssue: https://github.com/dotnet/runtime/issues/29969
39+ ProviderName = providerNames . Contains ( "MSOLEDBSQL19" )
40+ ? "MSOLEDBSQL19"
41+ : providerNames . Contains ( "MSOLEDBSQL" )
42+ ? "MSOLEDBSQL"
43+ : null ;
44+
45+ if ( ProviderName is not null )
46+ {
47+ IsAvailable = true ;
48+ }
4149 }
42- ProviderName = IsAvailable ? ExpectedProviderName : null ;
4350 }
4451 }
4552 }
0 commit comments