Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AccessViolationException using System.Data.OleDb #981

Closed
danielSt-dev opened this issue Dec 17, 2019 · 55 comments · Fixed by #32207
Closed

AccessViolationException using System.Data.OleDb #981

danielSt-dev opened this issue Dec 17, 2019 · 55 comments · Fixed by #32207

Comments

@danielSt-dev
Copy link

danielSt-dev commented Dec 17, 2019

Hi all,

we get a AccessViolationException when using System.Data.OleDb with "Microsoft OLE DB Provider for Visual FoxPro 9.0" (vfpoledb) after inserting a new row with a DataTable and OleDbDataAdapter.Update().

ExceptionDetails:
    StackTrace: null
    Data: {System.Collections.ListDictionaryInternal}
    HResult: -2147467261
    HelpLink: null
    InnerException: null
    Message: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
    Source: null
    TargetSite: null

Fatal error. 0xC0000005
   at System.Data.Common.UnsafeNativeMethods+ICommandWithParameters.SetParameterInfo(IntPtr, IntPtr[], System.Data.OleDb.tagDBPARAMBINDINFO[])
   at System.Data.OleDb.OleDbCommand.ApplyParameterBindings(ICommandWithParameters, System.Data.OleDb.tagDBPARAMBINDINFO[])
   at System.Data.OleDb.OleDbCommand.CreateAccessor()
   at System.Data.OleDb.OleDbCommand.InitializeCommand(System.Data.CommandBehavior, Boolean)
   at System.Data.OleDb.OleDbCommand.ExecuteCommand(System.Data.CommandBehavior, System.Object ByRef)
   at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(System.Data.CommandBehavior, System.String)
   at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
   at System.Data.Common.DbDataAdapter.UpdateRowExecute(System.Data.Common.RowUpdatedEventArgs, System.Data.IDbCommand, System.Data.StatementType)
   at System.Data.Common.DbDataAdapter.Update(System.Data.DataRow[], System.Data.Common.DataTableMapping)
   at System.Data.Common.DbDataAdapter.UpdateFromDataTable(System.Data.DataTable, System.Data.Common.DataTableMapping)
   at System.Data.Common.DbDataAdapter.Update(System.Data.DataTable)
   at OleDBTest.Program.Main(System.String[])

associated Code:

 using (OleDbConnection oledbConn = new OleDbConnection(@"Provider=vfpoledb;Data Source=d:\temp\dbfile.dbf;Collating Sequence = machine;")) {
    oledbConn.Open();
      using (OleDbDataAdapter da = new OleDbDataAdapter($"select * from dbfile.dbf", oledbConn)) {
        OleDbCommandBuilder cb = new OleDbCommandBuilder(da);
        da.InsertCommand = cb.GetInsertCommand();
        DataTable dt = new DataTable();
        da.Fill(dt);

        var customerRow = dt.NewRow();
        //Fill columns
        dt.Rows.Add(customerRow);
       da.Update(dt); // <-- the AccessViolationException is thrown here
    }
}

We ported the code from classic .Net Framework (4.8) where the code works without a problem.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Data untriaged New issue has not been triaged by the area owner labels Dec 17, 2019
@danmoseley
Copy link
Member

I wonder whether you could get more callstack out of a native debugger? Probably this is all there is, but worth a try?

@maryamariyan
Copy link
Member

maryamariyan commented Dec 17, 2019

@danielSt-dev
Copy link
Author

@danmosemsft
So, I have tried to get the exception details out of windbg (the new windbg preview from microsoft store ;-)

Here is the output from windbg command window:

exception occured:

(fec.880): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=000006e9 ebx=08f14f9e ecx=00000001 edx=0277e89c esi=0867653c edi=0277e8b4
eip=0c0b40b4 esp=0277e870 ebp=0277e8d8 iopl=0         nv up ei pl nz na po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010202
vfpoledb!DllGetClassObject+0xb92b:
0c0b40b4 668b08          mov     cx,word ptr [eax]        ds:002b:000006e9=????


0:000> k
 # ChildEBP RetAddr  
WARNING: Stack unwind information not available. Following frames may be wrong.
00 0277e8d8 0866752b vfpoledb!DllGetClassObject+0xb92b
01 0277e980 08667414 0x866752b
02 0277e9a8 08666332 0x8667414
03 0277e9dc 07e19613 0x8666332
04 0277e9fc 07e190e9 0x7e19613
05 0277ea10 07e189e8 0x7e190e9
06 0277ea90 08666217 0x7e189e8
07 0277eaa0 305e953b 0x8666217
08 0277eaf4 305e8c0e System_Data_Common!System.Data.Common.DbDataAdapter.UpdateRowExecute(System.Data.Common.RowUpdatedEventArgs, System.Data.IDbCommand, System.Data.StatementType)$##60016CD+0x3f
09 0277eb84 305e94f1 System_Data_Common!System.Data.Common.DbDataAdapter.Update(System.Data.DataRow[], System.Data.Common.DataTableMapping)$##60016C9+0x742
0a 0277eb98 305e824e System_Data_Common!System.Data.Common.DbDataAdapter.UpdateFromDataTable(System.Data.DataTable, System.Data.Common.DataTableMapping)$##60016CC+0x2d
0b 0277ebe4 06fb254f System_Data_Common!System.Data.Common.DbDataAdapter.Update(System.Data.DataTable)$##60016C7+0x18a
0c 0277ec48 0fb29a2f 0x6fb254f
0d 0277ec54 0fac9254 coreclr!CallDescrWorkerInternal+0x34 [F:\workspace\_work\1\s\src\vm\i386\asmhelpers.asm @ 615] 
0e (Inline) -------- coreclr!CallDescrWorkerWithHandler+0x55 [f:\workspace\_work\1\s\src\vm\callhelpers.cpp @ 70] 
0f 0277ecec 0fb1b189 coreclr!MethodDescCallSite::CallTargetWorker+0x167 [f:\workspace\_work\1\s\src\vm\callhelpers.cpp @ 604] 
10 (Inline) -------- coreclr!MethodDescCallSite::Call+0x11 [f:\workspace\_work\1\s\src\vm\callhelpers.h @ 468] 
11 0277ee60 0fa8ca12 coreclr!RunMain+0x1e3 [f:\workspace\_work\1\s\src\vm\assembly.cpp @ 1558] 
12 0277f0c4 0fa8c614 coreclr!Assembly::ExecuteMainMethod+0x178 [f:\workspace\_work\1\s\src\vm\assembly.cpp @ 1681] 
13 0277f1b0 0fa8c433 coreclr!CorHost2::ExecuteAssembly+0x184 [f:\workspace\_work\1\s\src\vm\corhost.cpp @ 460] 
14 0277f204 568b46e6 coreclr!coreclr_execute_assembly+0xd3 [f:\workspace\_work\1\s\src\dlls\mscoree\unixinterface.cpp @ 412] 
15 0277f228 568c2e1d hostpolicy!coreclr_t::execute_assembly+0x26 [f:\workspace\_work\1\s\src\corehost\cli\hostpolicy\coreclr.cpp @ 145] 
16 0277f2d8 568c2a87 hostpolicy!run_app_for_context+0x33d [f:\workspace\_work\1\s\src\corehost\cli\hostpolicy\hostpolicy.cpp @ 247] 
17 0277f310 568c3bd1 hostpolicy!run_app+0x57 [f:\workspace\_work\1\s\src\corehost\cli\hostpolicy\hostpolicy.cpp @ 276] 
18 0277f418 5694d129 hostpolicy!corehost_main+0xf1 [f:\workspace\_work\1\s\src\corehost\cli\hostpolicy\hostpolicy.cpp @ 390] 
19 0277f48c 5694fa56 hostfxr!execute_app+0x309 [f:\workspace\_work\1\s\src\corehost\cli\fxr\fx_muxer.cpp @ 147] 
1a 0277f514 5694eafe hostfxr!`anonymous namespace'::read_config_and_execute+0xa6 [f:\workspace\_work\1\s\src\corehost\cli\fxr\fx_muxer.cpp @ 502] 
1b 0277f578 5694cd65 hostfxr!fx_muxer_t::handle_exec_host_command+0xee [f:\workspace\_work\1\s\src\corehost\cli\fxr\fx_muxer.cpp @ 952] 
1c 0277f68c 569493d6 hostfxr!fx_muxer_t::execute+0x225 [f:\workspace\_work\1\s\src\corehost\cli\fxr\fx_muxer.cpp @ 541] 
1d 0277f720 0015f3a3 hostfxr!hostfxr_main_startupinfo+0x76 [f:\workspace\_work\1\s\src\corehost\cli\fxr\hostfxr.cpp @ 33] 
1e 0277f874 0015f59e apphost!exe_start+0x7e3 [f:\workspace\_work\1\s\src\corehost\corehost.cpp @ 220] 
1f 0277f890 00160dec apphost!wmain+0x6e [f:\workspace\_work\1\s\src\corehost\corehost.cpp @ 279] 
20 (Inline) -------- apphost!invoke_main+0x1c [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 90] 
21 0277f8d8 75440419 apphost!__scrt_common_main_seh+0xfa [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288] 
22 0277f8e8 7714662d KERNEL32!BaseThreadInitThunk+0x19
23 0277f944 771465fd ntdll!__RtlUserThreadStart+0x2f
24 0277f954 00000000 ntdll!_RtlUserThreadStart+0x1b


0:000> !analyze -v
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

Failed to request MethodData, not in JIT code range
MethodDesc:   086d9478
Method Name:          ILStubClass.IL_STUB_CLRtoCOM(IntPtr, IntPtr[], System.Data.OleDb.tagDBPARAMBINDINFO[])
Class:                07078b98
MethodTable:          07078bec
mdToken:              06000000
Module:               07077834
IsJitted:             yes
Current CodeAddr:     08667440
Version History:
  ILCodeVersion:      00000000
  ReJIT ID:           0
  IL Addr:            00000000
     CodeAddr:           08667440  (Optimized)
     NativeCodeVersion:  00000000
MethodDesc:   06fcb364
Method Name:          System.Data.OleDb.OleDbCommand.ApplyParameterBindings(ICommandWithParameters, System.Data.OleDb.tagDBPARAMBINDINFO[])
Class:                06ff68d0
MethodTable:          06fcb7b0
mdToken:              060002F4
Module:               070a922c
IsJitted:             yes
Current CodeAddr:     086673c8
Version History:
  ILCodeVersion:      00000000
  ReJIT ID:           0
  IL Addr:            00000000
     CodeAddr:           086673c8  (Optimized)
     NativeCodeVersion:  00000000
Source file:  /_/src/System.Data.OleDb/src/OleDbCommand.cs @ 423
MethodDesc:   06fcb354
Method Name:          System.Data.OleDb.OleDbCommand.CreateAccessor()
Class:                06ff68d0
MethodTable:          06fcb7b0
mdToken:              060002F3
Module:               070a922c
IsJitted:             yes
Current CodeAddr:     08666238
Version History:
  ILCodeVersion:      00000000
  ReJIT ID:           0
  IL Addr:            00000000
     CodeAddr:           08666238  (Optimized)
     NativeCodeVersion:  00000000
Source file:  /_/src/System.Data.OleDb/src/OleDbCommand.cs @ 401
MethodDesc:   06fcb578
Method Name:          System.Data.OleDb.OleDbCommand.InitializeCommand(System.Data.CommandBehavior, Boolean)
Class:                06ff68d0
MethodTable:          06fcb7b0
mdToken:              06000315
Module:               070a922c
IsJitted:             yes
Current CodeAddr:     07e19558
Version History:
  ILCodeVersion:      00000000
  ReJIT ID:           0
  IL Addr:            00000000
     CodeAddr:           07e19558  (QuickJitted)
     NativeCodeVersion:  00000000
Source file:  /_/src/System.Data.OleDb/src/OleDbCommand.cs @ 1141
MethodDesc:   06fcb480
Method Name:          System.Data.OleDb.OleDbCommand.ExecuteCommand(System.Data.CommandBehavior, System.Object ByRef)
Class:                06ff68d0
MethodTable:          06fcb7b0
mdToken:              06000306
Module:               070a922c
IsJitted:             yes
Current CodeAddr:     07e190d0
Version History:
  ILCodeVersion:      00000000
  ReJIT ID:           0
  IL Addr:            00000000
     CodeAddr:           07e190d0  (QuickJitted)
     NativeCodeVersion:  00000000
Source file:  /_/src/System.Data.OleDb/src/OleDbCommand.cs @ 764
MethodDesc:   06fcb470
Method Name:          System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(System.Data.CommandBehavior, System.String)
Class:                06ff68d0
MethodTable:          06fcb7b0
mdToken:              06000305
Module:               070a922c
IsJitted:             yes
Current CodeAddr:     07e18968
Version History:
  ILCodeVersion:      00000000
  ReJIT ID:           0
  IL Addr:            00000000
     CodeAddr:           07e18968  (QuickJitted)
     NativeCodeVersion:  00000000
Source file:  /_/src/System.Data.OleDb/src/OleDbCommand.cs @ 622
MethodDesc:   06fcb4f0
Method Name:          System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
Class:                06ff68d0
MethodTable:          06fcb7b0
mdToken:              0600030D
Module:               070a922c
IsJitted:             yes
Current CodeAddr:     086661f8
Version History:
  ILCodeVersion:      00000000
  ReJIT ID:           0
  IL Addr:            00000000
     CodeAddr:           086661f8  (QuickJitted)
     NativeCodeVersion:  00000000
Source file:  /_/src/System.Data.OleDb/src/OleDbCommand.cs @ 917
MethodDesc:   06dbf358
Method Name:          OleDbTest.Program.Main(System.String[])
Class:                06ec555c
MethodTable:          06dbf374
mdToken:              06000001
Module:               06dbdfa0
IsJitted:             yes
Current CodeAddr:     06fb2428
Version History:
  ILCodeVersion:      00000000
  ReJIT ID:           0
  IL Addr:            00000000
     CodeAddr:           06fb2428  (MinOptJitted)
     NativeCodeVersion:  00000000
Source file:  D:\Testanwendungen\OleDbTest\Program.cs @ 22

KEY_VALUES_STRING: 1
    Key  : AV.Fault
    Value: Read

    Key  : Analysis.CPU.Sec
    Value: 2

    Key  : Analysis.DebugAnalysisProvider.CPP
    Value: Create: 8007007e on DESLNPC220

    Key  : Analysis.DebugData
    Value: CreateObject

    Key  : Analysis.DebugModel
    Value: CreateObject

    Key  : Analysis.Elapsed.Sec
    Value: 4

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 164

    Key  : Analysis.System
    Value: CreateObject

    Key  : CLR.Engine
    Value: CORECLR

    Key  : CLR.Version
    Value: 4.700.19.56402

    Key  : Timeline.OS.Boot.DeltaSec
    Value: 8134

    Key  : Timeline.Process.Start.DeltaSec
    Value: 1138

ADDITIONAL_XML: 1
NTGLOBALFLAG:  70
PROCESS_BAM_CURRENT_THROTTLED: 0
PROCESS_BAM_PREVIOUS_THROTTLED: 0
APPLICATION_VERIFIER_FLAGS:  0

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 0c0b40b4 (vfpoledb!DllGetClassObject+0x0000b92b)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: 000006e9
Attempt to read from address 000006e9

FAULTING_THREAD:  00000880
PROCESS_NAME:  apphost.exe
READ_ADDRESS:  000006e9 
ERROR_CODE: (NTSTATUS) 0xc0000005 - Die Anweisung in 0x%p verwies auf Arbeitsspeicher bei 0x%p. Der Vorgang %s konnte im Arbeitsspeicher nicht durchgef hrt werden.
EXCEPTION_CODE_STR:  c0000005
EXCEPTION_PARAMETER1:  00000000
EXCEPTION_PARAMETER2:  000006e9

IP_ON_HEAP:  0866752b
The fault address in not in any loaded module, please check your build's rebase
log at <releasedir>\bin\build_logs\timebuild\ntrebase.log for module which may
contain the address if it were loaded.

FRAME_ONE_INVALID: 1

STACK_TEXT:  
WARNING: Stack unwind information not available. Following frames may be wrong.
0277e8d8 0866752b 086764c4 0000002c 04986f5c vfpoledb!DllGetClassObject+0xb92b
0277e980 08667414 04985bec 04986f54 0498458c 0x866752b
0277e9a8 08666332 04985bec 0493eb6c 0498485c 0x8667414
0277e9dc 07e19613 00000000 00000000 00000000 0x8666332
0277e9fc 07e190e9 00000000 00000000 0493e270 0x7e19613
0277ea10 07e189e8 0277ea58 00000000 00000000 0x7e190e9
0277ea90 08666217 04984560 0493e270 0277eaf4 0x7e189e8
0277eaa0 305e953b 00000000 00000008 00638927 0x8666217
0277eaf4 305e8c0e 00000001 0493e270 00000000 System_Data_Common!System.Data.Common.DbDataAdapter.UpdateRowExecute(System.Data.Common.RowUpdatedEventArgs, System.Data.IDbCommand, System.Data.StatementType)$##60016CD+0x3f
0277eb84 305e94f1 049812b0 04921fbc 04942360 System_Data_Common!System.Data.Common.DbDataAdapter.Update(System.Data.DataRow[], System.Data.Common.DataTableMapping)$##60016C9+0x742
0277eb98 305e824e 049812b0 049111c8 00000000 System_Data_Common!System.Data.Common.DbDataAdapter.UpdateFromDataTable(System.Data.DataTable, System.Data.Common.DataTableMapping)$##60016CC+0x2d
0277ebe4 06fb254f 00000000 049425d8 049811e8 System_Data_Common!System.Data.Common.DbDataAdapter.Update(System.Data.DataTable)$##60016C7+0x18a
0277ec48 0fb29a2f 00000008 0277ecec 0fac9254 0x6fb254f
0277ec54 0fac9254 0277ecc0 0277ee50 0faa5d80 coreclr!CallDescrWorkerInternal+0x34
0277ecec 0fb1b189 0277ee28 00000000 00000000 coreclr!MethodDescCallSite::CallTargetWorker+0x167
0277ee60 0fa8ca12 0277ee94 0277f198 aa5da6d9 coreclr!RunMain+0x1e3
0277f0c4 0fa8c614 0277f198 80004005 aa5da7ad coreclr!Assembly::ExecuteMainMethod+0x178
0277f1b0 0fa8c433 0281203c 00000001 02844f58 coreclr!CorHost2::ExecuteAssembly+0x184
0277f204 568b46e6 0281203c 00000001 00000000 coreclr!coreclr_execute_assembly+0xd3
0277f228 568c2e1d 00000000 00000000 02844ad8 hostpolicy!coreclr_t::execute_assembly+0x26
0277f2d8 568c2a87 02811b90 00000000 027fe354 hostpolicy!run_app_for_context+0x33d
0277f310 568c3bd1 00000000 027fe354 568c3ae0 hostpolicy!run_app+0x57
0277f418 5694d129 00000001 027fe350 e42af621 hostpolicy!corehost_main+0xf1
0277f48c 5694fa56 0277f4ec 0280fb98 00000001 hostfxr!execute_app+0x309
0277f514 5694eafe 0277f694 0277f6d4 0277f664 hostfxr!`anonymous namespace'::read_config_and_execute+0xa6
0277f578 5694cd65 0277f694 0277f6d4 0277f664 hostfxr!fx_muxer_t::handle_exec_host_command+0xee
0277f68c 569493d6 02800000 0280d7a0 0280d888 hostfxr!fx_muxer_t::execute+0x225
0277f720 0015f3a3 00000001 027fe350 0280d888 hostfxr!hostfxr_main_startupinfo+0x76
0277f874 0015f59e 00000001 027fe350 027fe350 apphost!exe_start+0x7e3
0277f890 00160dec 00000001 027fe350 027fce28 apphost!wmain+0x6e
0277f8d8 75440419 02598000 75440400 0277f944 apphost!__scrt_common_main_seh+0xfa
0277f8e8 7714662d 02598000 38d39b8b 0

0000000 KERNEL32!BaseThreadInitThunk+0x19
0277f944 771465fd ffffffff 771651df 00000000 ntdll!__RtlUserThreadStart+0x2f
0277f954 00000000 00160e80 02598000 00000000 ntdll!_RtlUserThreadStart+0x1b

STACK_COMMAND:  ~0s ; .cxr ; kb
SYMBOL_NAME:  vfpoledb!DllGetClassObject+b92b
MODULE_NAME: vfpoledb
IMAGE_NAME:  vfpoledb.dll
FAILURE_BUCKET_ID:  NULL_CLASS_PTR_READ_c0000005_vfpoledb.dll!DllGetClassObject
BUCKET_ID_MODPRIVATE: 1
OS_VERSION:  10.0.17763.1
BUILDLAB_STR:  rs5_release
OSPLATFORM_TYPE:  x86
OSNAME:  Windows 10
FAILURE_ID_HASH:  {98f4425d-e56d-c1e8-ee21-0703cc81a526}
Followup:     MachineOwner
---------

.net core 3.1 sample project including foxpro-Database attached:
OleDbTest.zip

Visua FoxPro oledb driver downloaded from:
https://www.microsoft.com/en-us/download/details.aspx?id=14839

Please let me know if you need further infos.

@cheenamalhotra
Copy link
Member

From the source code it seems you're tryjng to update "da" object after using block is closed? Could you place it inside using block and try again plz?

using (OleDbConnection oledbConn = new OleDbConnection(@"Provider=vfpoledb;Data Source=d:\temp\dbfile.dbf;Collating Sequence = machine;")) {
    oledbConn.Open();
      using (OleDbDataAdapter da = new OleDbDataAdapter($"select * from dbfile.dbf", oledbConn)) {
        OleDbCommandBuilder cb = new OleDbCommandBuilder(da);
        da.InsertCommand = cb.GetInsertCommand();
        DataTable dt = new DataTable();
        da.Fill(dt);

        var customerRow = dt.NewRow();
        //Fill columns
        dt.Rows.Add(customerRow);
        da.Update(dt);
    }
}

@danielSt-dev
Copy link
Author

From the source code it seems you're tryjng to update "da" object after using block is closed? Could you place it inside using block and try again plz?

using (OleDbConnection oledbConn = new OleDbConnection(@"Provider=vfpoledb;Data Source=d:\temp\dbfile.dbf;Collating Sequence = machine;")) {
    oledbConn.Open();
      using (OleDbDataAdapter da = new OleDbDataAdapter($"select * from dbfile.dbf", oledbConn)) {
        OleDbCommandBuilder cb = new OleDbCommandBuilder(da);
        da.InsertCommand = cb.GetInsertCommand();
        DataTable dt = new DataTable();
        da.Fill(dt);

        var customerRow = dt.NewRow();
        //Fill columns
        dt.Rows.Add(customerRow);
        da.Update(dt);
    }
}

@cheenamalhotra: aah, sorry. my mistake while formatting the code in github.
The da.Update(dt) of course is within the using block and can't be outside because of compiler error.

initial comment was updated and thanks for the hint.

@jader1313
Copy link

I tested using a LocalDB database and OLE DB Driver for SQL Server and got a error too.

"Provider=MSOLEDBSQL;Server=(localdb)\MSSQLLocalDB;Database=SarathlalDb;DataTypeCompatibility=80;Integrated Security=SSPI; "

System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

@cheenamalhotra
Copy link
Member

cheenamalhotra commented Dec 19, 2019

On testing same application with .NET Framework (tested 4.0-4.8), I see below exception:

System.Data.OleDb.OleDbException: 'Field DQSCHEMA does not accept null values.'

Which is expected exception and gets errors back from Native DLL. Whereas in .NET Core, the HRResult itself is not retrieved and Native DLL fails with reported exception from vfpoledb.dll

Exception thrown at 0x0C0B40B4 (vfpoledb.dll) in OleDbTest.exe: 0xC0000005: Access violation reading location 0x000007E1.

On comparing OleDbCommand.cs for .NET Core and .NET Framework reference, I see 1 difference which I'm not sure how relevant it is:

In .NET Core:

public new OleDbDataReader ExecuteReader(CommandBehavior behavior)
{
_executeQuery = true;
return ExecuteReaderInternal(behavior, ADP.ExecuteReader);
}

In .NET Framework reference (link):

        new public OleDbDataReader ExecuteReader(CommandBehavior behavior) {
            OleDbConnection.ExecutePermission.Demand();
 
            IntPtr hscp;
            Bid.ScopeEnter(out hscp, "<oledb.OleDbCommand.ExecuteReader|API> %d#, behavior=%d{ds.CommandBehavior}\n", ObjectID, (int)behavior);
            try {
                _executeQuery = true;
                return ExecuteReaderInternal(behavior, ADP.ExecuteReader);
            }
            finally {
                Bid.ScopeLeave(ref hscp);
            }
        }

OleDbConnection.ExecutePermission.Demand(); is what seemed missing in .NET Core for all Execute APIs not just one.

@stephentoub @roji would that be related to user's issue? Could someone give it a try?

@jader1313
Copy link

I believe the problem is related to this https://github.com/dotnet/corefx/issues/42596

@cheenamalhotra
Copy link
Member

@jader1313

Could you also provide a repro with provider MSOLEDBSQL with LocalDB where you experience this?

@jader1313
Copy link

In .Net Core 3.0 or 3.1 with 1 parameter works, but with 2 or more parameters error occurs. Following example:

    string StrConn = "Provider=MSOLEDBSQL;Server=(localdb)\\MSSQLLocalDB;Database=SarathlalDb;DataTypeCompatibility=80;Integrated Security=SSPI; ";
    using (OleDbConnection connection = new OleDbConnection(StrConn))
    {
        connection.Open();
        using (OleDbCommand command = new OleDbCommand())
        {
            command.Connection = connection;
            command.CommandText =
                "INSERT INTO Employees(Id, Name) VALUES(?,?)";

            var par = new OleDbParameter();
            par.OleDbType = OleDbType.VarChar;
            par.Size = 250;
            par.Value = Guid.NewGuid().ToString();
            command.Parameters.Add(par);

            par = new OleDbParameter();
            par.OleDbType = OleDbType.VarChar;
            par.Size = 250;
            par.Value = "Test";
            command.Parameters.Add(par);
            command.Prepare();
            try
            {
                command.ExecuteNonQuery();
            }
            catch (InvalidOperationException e)
            {
                Console.WriteLine("ERRO: Could not perform INSERT INTO.", "SQL", command.CommandText);
                throw e;
            }
        }
    }

@danielSt-dev
Copy link
Author

@cheenamalhotra

On testing same application with .NET Framework (tested 4.0-4.8), I see below exception:

System.Data.OleDb.OleDbException: 'Field DQSCHEMA does not accept null values.'

In the testapp I haven't considered the database scheme because I thought it is unnecessary. In our production app the row is correctly filled of course.
Attached is the modified testapp with a correctly filled row. So in .NET Framework 4.8 no exception is thrown and the row is inserted correctly.
In .NET Core 3.1 the AccessViolationException is still there.

I hope this helps for debugging and research.
OleDbTest.zip

@JoeHz
Copy link

JoeHz commented Jan 4, 2020

I believe I am seeing this as well. I'm porting this (working...well it was under .NET Framework) to .NetCore.

I'm connecting to a very old AccessDB via OLE40 (this application is "glue" between that file and an SQL Server Database I use EF to talk to). Inside of a timed event I call some stored queries in the .mdb file, and that works just fine. Later on however, I get the same exception being reported here on the call to ExecuteReader(). This is my first mucking with .netcore, so bear with me.

EDIT/ADD: Later or earlier makes no difference. Any call to this query fails., even if I use a pooled connection.

            List<Player>
                people = bm.Players.Where(p => p.Name == "").ToList();

            OleDbCommand cmd2 = new OleDbCommand(
                    "Select * from [PlayerNumbers] where [Section] = ? AND [Table] = ? AND [Direction] = ?",
                    window._conn);

            foreach (var person in people)
            {
                cmd2.Parameters.Clear();

                cmd2.Parameters.AddWithValue("[Section]", person.SectionId);
                cmd2.Parameters.AddWithValue("[Table]", person.TableNumber);
                cmd2.Parameters.AddWithValue("[Direction]", person.Direction);

                OleDbDataReader reader2 = cmd2.ExecuteReader(); // EXCEPTION THROWN


@jader1313
Copy link

@ajcvickers @cheenamalhotra @ David-Engel @cheenamalhotra @ danielSt-dev @JoeHz:

Is there any way we can prioritize the solution of this problem, I think it's a major problem as it apparently affects System.Data.OleDb with any database.

@jader1313
Copy link

@David-Engel

@jader1313
Copy link

@maryamariyan @divega @cheenamalhotra @danmosemsft @saurabh500 @msftgits
We are converting an EF6 provider to EF Core, but we are not getting ahead due to this problem with OleDbCommand with more than one parameter. We are stopped for almost 60 days, can someone help in solving this bug or at least give some forwarding?

@maryamariyan
Copy link
Member

maryamariyan commented Feb 5, 2020

@jader1313 do you mind adding your test case in a PR to OLEDB here and confirming the difference in behavior by running your test case in the two different frameworks (.net core and .net framework)?

Here is a doc page showing how to build and run tests on the runtime repo and to run in different frameworks:
https://github.com/dotnet/runtime/tree/master/docs/workflow/building/libraries

@jader1313
Copy link

@maryamariyan I tried to run the tests but I am getting the following error:

[05/02/2020 9:59:42.882 ] ---------- Discovery started ----------
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: O processo do testhost foi encerrado com o erro: It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '5.0.0' was not found.

  • The following frameworks were found:
    3.1.1 at [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
    You can resolve the problem by installing the specified framework and/or SDK.
    The specified framework can be found at:
  • https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x86&rid=win10-x86
    . Verifique os logs de diagnóstico para obter mais informações.
    em Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.ThrowOnTestHostExited(Boolean testHostExited)
    em Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
    em Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)
    [05/02/2020 9:59:42.951 ] ========== Discovery aborted: 0 tests found (0:00:00,0647166) ==========
    [05/02/2020 9:59:42.981 ] ---------- Run started ----------
    O processo do testhost foi encerrado com o erro: It was not possible to find any compatible framework version
    The framework 'Microsoft.NETCore.App', version '5.0.0' was not found.
  • The following frameworks were found:
    3.1.1 at [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
    You can resolve the problem by installing the specified framework and/or SDK.
    The specified framework can be found at:
  • https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x86&rid=win10-x86
    . Verifique os logs de diagnóstico para obter mais informações.
    O processo do testhost foi encerrado com o erro: It was not possible to find any compatible framework version
    The framework 'Microsoft.NETCore.App', version '5.0.0' was not found.
  • The following frameworks were found:
    3.1.1 at [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
    You can resolve the problem by installing the specified framework and/or SDK.
    The specified framework can be found at:
  • https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x86&rid=win10-x86
    . Verifique os logs de diagnóstico para obter mais informações.
    [05/02/2020 9:59:43.148 ] ========== Run aborted: 0 tests run (0:00:00,0720318) ==========

But i have:

C:\Projetos\DotNet\Desenvolvimento\DotNetCore\runtime.dotnet
SDK do .NET Core (refletindo qualquer global.json):
Version: 5.0.100-alpha.1.20073.4
Commit: bafdca8cc2

Ambiente de runtime:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Projetos\DotNet\Desenvolvimento\DotNetCore\runtime.dotnet\sdk\5.0.100-alpha.1.20073.4\

Host (useful for support):
Version: 5.0.0-alpha.1.20070.4
Commit: 46d7bec

.NET Core SDKs installed:
5.0.100-alpha.1.20073.4 [C:\Projetos\DotNet\Desenvolvimento\DotNetCore\runtime.dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 5.0.0-alpha.1.20071.6 [C:\Projetos\DotNet\Desenvolvimento\DotNetCore\runtime.dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0-alpha.1.20070.4 [C:\Projetos\DotNet\Desenvolvimento\DotNetCore\runtime.dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.0-alpha.1.20073.3 [C:\Projetos\DotNet\Desenvolvimento\DotNetCore\runtime.dotnet\shared\Microsoft.WindowsDesktop.App]

@joperezr
Copy link
Member

joperezr commented Feb 5, 2020

@jader1313 The error you are getting while running the tests is probably because you didn't follow all of the steps in order to run them. What we do is that we will build a special SDK during our regular build in the repo, and then we will use that one to run our tests, but looks like you didn't do that and only installed a 5.0 sdk which is not enough. In order to be able to run our tests please run the following commands from a command prompt:

<runtimeRepoRoot>\coreclr.cmd -configuration Release
<runtimeRepoRoot>\libraries.cmd /p:CoreClrConfiguration=Release
<runtimeRepoRoot>\.dotnet\dotnet.exe msbuild src\libraries\System.Data.OleDb\tests\System.Data.OleDb.Tests.csproj /t:RebuildAndTest

That should get the tests from that test project to run. If you want to add test cases and re run the tests, you only have to run that last command, no need to re run the first two which will take longer.

@maryamariyan
Copy link
Member

maryamariyan commented Feb 5, 2020

@jader1313 I just realized our official builds on dotnet/runtime don't build for netfx any longer. However you can still follow @joperezr instructions to run any dotnet/runtime test for .net core.

In order to run your test against both netfx and netcoreapp you would need to add your test in the release/3.1 branch in dotnet/corefx repo. You can run the tests to make sure that there is a change in behavior between .net core and .net framework.

Read this two pages to learn how to run tests:

What you can also do is to write a console app targeting both netcoreapp and netfx that exercises your test case and share if there any behavioral differences.

@jader1313
Copy link

@maryamariyan I had already executed the instructions on the website https://github.com/dotnet/runtime/blob/master/docs/workflow/building/libraries/README.md but I followed the instructions suggested by @joperezr again and got the following results:

Discovering: System.Data.OleDb.Tests (method display = ClassAndMethod, method display options = None)
Discovered: System.Data.OleDb.Tests (found 46 of 81 test cases)
Starting: System.Data.OleDb.Tests (parallel test collections = on, max threads = 12)
System.Data.OleDb.Tests.OleDbCommandBuilderTests.DeriveParameters_NullCommandText_Throws [SKIP]
Condition(s) not met: "GetIsDriverAvailable"
System.Data.OleDb.Tests.OleDbCommandBuilderTests.DeriveParameters_NullCommand_Throws [SKIP]
Condition(s) not met: "GetIsDriverAvailable"

	..........
	..........
	
Finished:    System.Data.OleDb.Tests

=== TEST EXECUTION SUMMARY ===
System.Data.OleDb.Tests Total: 46, Errors: 0, Failed: 0, Skipped: 46, Time: 0,144s

LOG.zip

In Visual Studio / Test Explorer when running RUN ALL TESTS the result is 91 NOT RUN TESTS

Output:
[05/02/2020 6:31:21.979 ] ---------- Discovery started ----------
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: O processo do testhost foi encerrado com o erro: It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '5.0.0' was not found.

  • The following frameworks were found:
    3.1.1 at [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
    You can resolve the problem by installing the specified framework and/or SDK.
    The specified framework can be found at:
  • https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x86&rid=win10-x86
    . Verifique os logs de diagnóstico para obter mais informações.
    em Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.ThrowOnTestHostExited(Boolean testHostExited)
    em Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
    em Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)
    [05/02/2020 6:31:22.047 ] ========== Discovery aborted: 0 tests found (0:00:00,0681689) ==========
    [05/02/2020 6:31:22.069 ] ---------- Run started ----------
    O processo do testhost foi encerrado com o erro: It was not possible to find any compatible framework version
    The framework 'Microsoft.NETCore.App', version '5.0.0' was not found.
  • The following frameworks were found:
    3.1.1 at [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
    You can resolve the problem by installing the specified framework and/or SDK.
    The specified framework can be found at:
  • https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x86&rid=win10-x86
    . Verifique os logs de diagnóstico para obter mais informações.
    O processo do testhost foi encerrado com o erro: It was not possible to find any compatible framework version
    The framework 'Microsoft.NETCore.App', version '5.0.0' was not found.
  • The following frameworks were found:
    3.1.1 at [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
    You can resolve the problem by installing the specified framework and/or SDK.
    The specified framework can be found at:
  • https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x86&rid=win10-x86
    . Verifique os logs de diagnóstico para obter mais informações.
    [05/02/2020 6:31:22.176 ] ========== Run aborted: 0 tests run (0:00:00,1068654) ==========

@jader1313
Copy link

But the test I would create would be an adaptation of this code:

string StrConn = "Provider=MSOLEDBSQL;Server=(localdb)\\MSSQLLocalDB;Database=SarathlalDb;DataTypeCompatibility=80;Integrated Security=SSPI; ";
using (OleDbConnection connection = new OleDbConnection(StrConn))
{
    connection.Open();
    using (OleDbCommand command = new OleDbCommand())
    {
        command.Connection = connection;
        command.CommandText =
            "INSERT INTO Employees(Id, Name) VALUES(?,?)";

        var par = new OleDbParameter();
        par.OleDbType = OleDbType.VarChar;
        par.Size = 250;
        par.Value = Guid.NewGuid().ToString();
        command.Parameters.Add(par);

        par = new OleDbParameter();
        par.OleDbType = OleDbType.VarChar;
        par.Size = 250;
        par.Value = "Test";
        command.Parameters.Add(par);
        command.Prepare();
        try
        {
            command.ExecuteNonQuery();
        }
        catch (InvalidOperationException e)
        {
            Console.WriteLine("ERRO: Could not perform INSERT INTO.", "SQL", command.CommandText);
            throw e;
        }
    }
}

@maryamariyan
Copy link
Member

maryamariyan commented Feb 5, 2020

@jader1313 I believe we already have tests on the repo exercising the code path you are sharing:

e.g. https://github.com/dotnet/runtime/blob/master/src/libraries/System.Data.OleDb/tests/OleDbCommandTests.cs#L137-L175

@jader1313
Copy link

@maryamariyan I redid the previous test with LocalDB and realized that it passes in .Net Core x64 but presents the error in x86.
Visual FoxPro, for example, only has a 32-bit driver.

@jader1313
Copy link

@maryamariyan I prepared a complete solution to carry out the tests, just being able to access a LocalDB. Attached below.

There are 2 projects:
ConsoleTestLocalDBFramework
ConsoleTestLocalDBCore

Running:
ConsoleTestLocalDBFramework -> x64 = OK
ConsoleTestLocalDBFramework -> x86 = OK
ConsoleTestLocalDBCore -> x64 = OK
ConsoleTestLocalDBCore -> x86 = ERROR

ConsoleTestLocalDB.zip

@jader1313
Copy link

Could you please inform me that you managed to reproduce the problem?

@FreddyDgh
Copy link
Contributor

My experience with using the MS Access OleDb driver aligns with what @jader1313 is saying:

  • Queries with more than one parameter succeed on .NET Framework x86/x64
  • Queries with more than one parameter fail on .NET Core x86
  • Queries with more than one parameter succeed on .NET Core x64

Switching to the x64 driver unblocks me for the moment, but I agree that the .NET Core x86 implementation should be fixed due to the fact that it's a pretty fundamental flaw.

@jader1313
Copy link

@FreddyD-GH thanks for your confirmation.

@maryamariyan as I was unable to run the System.Data.OleDB tests, I took the test you mentioned (https://github.com/dotnet/runtime/blob/master/src/libraries/System.Data.OleDb/tests/OleDbCommandTests.cs#L137-L175) and adapted my project to run it. When running on x86 it shows ERROR.

@maryamariyan
Copy link
Member

maryamariyan commented Feb 7, 2020

Thank you both for the complete description of the issue. Currently investigating, will give an update in a bit.

@jader1313
Copy link

@ericstj @maryamariyan @saurabh500 From what I saw the correction was implemented.

Only in v5.0? How do I force a project to use that version of the .Net Core to test?

We need this fix in version 3.1, is it possible?

@jader1313
Copy link

???

@jader1313
Copy link

TargetFramework = ???

@FreddyDgh
Copy link
Contributor

FreddyDgh commented Feb 17, 2020

@jader1313 I haven't had a chance to see if the fix works yet, but I think what we want to do is install the latest version of the System.Data.OleDb nuget package from the nightly package source (https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json).

For example, using the dotnet CLI:
dotnet add package System.Data.OleDb -v 5.0.0-preview.1.20117.4 -s https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json

If you have a chance to try this before I do, I'd appreciate knowing if that package fixes your issue.

Edit: It should still work on .NET Core 3.1, as far as I know.

@saurabh500
Copy link
Contributor

@jader1313 Try the feed that @FreddyD-GH has provided to get the nightly nuget package build of System.Data.OleDb. That should have the fix.

Also we haven't fixed the x86 problems completely and there is some more work that needs to be done. However I am not sure whether you are going to hit those issues or not.

At this point, I know that in the internals of System.Data.Oledb, there were some x86 based structs which are being incorrectly used on x64 causing this issue. I will be migrating those structs soon too.

@jader1313
Copy link

In initial tests the reported problem was resolved.
I noticed other problems in running x86 vs x64, the following commands do not work or return empty strings in x86 but work perfectly in x64:

  • command.Connection.ChangeDatabase (dbName);
  • connection.Database
  • connection.ServerVersion

@saurabh500
Copy link
Contributor

Thanks @jader1313 I will be looking into these issues.
I have opened #32509 to track the rest of the work.

@jader1313
Copy link

@saurabh500 In the project we are working on (https://github.com/tombrothers/VfpClient), running the tests, 360 tests showed only 1 error in x86 in command:

transaction.Rollback();

Exception thrown: 'System.Data.OleDb.OleDbException' in System.Data.OleDb.dll
VfpClient Error: 0 : VfpClient.VfpException (0x80004005): No error message available, result code: E_NOINTERFACE(0x80004002).
---> System.Data.OleDb.OleDbException (0x80004002): No error message available, result code: E_NOINTERFACE(0x80004002).
at System.Data.OleDb.OleDbTransaction.ProcessResults(OleDbHResult hr)
at System.Data.OleDb.OleDbTransaction.RollbackInternal(Boolean exceptionHandling)
at System.Data.OleDb.OleDbTransaction.Rollback()
at VfpClient.VfpTransaction.Rollback() in C:\Projetos\DotNet\Desenvolvimento\VfpClient\Source\VfpClient\VfpTransaction.cs:line 39

@jader1313
Copy link

@saurabh500 I need this one in 3.1 too, please!

@saurabh500
Copy link
Contributor

saurabh500 commented Mar 10, 2020

@jader1313 Right now I am not comfortable taking the fix for this issue to servicing.
The reason is that the change to fix this issue was just one part of fixing the x86 support.
Once I have the other x86 based struct packing tackled, I can consider taking a bunch of these changes tackling the x86 related issues for servicing.

@saurabh500
Copy link
Contributor

Also I can only propose a servicing fix, but then the approvals are subject to quality bar and risk evaluation.

@jader1313
Copy link

@saurabh500 I understand what you are saying, but we are working to port an EF6 provider Fox Pro (https://github.com/tombrothers/VfpEntityFrameworkProvider2) to the .Net Core. Fox Pro only has a 32-bit OleDB driver (VfpOleDB). With corrections # 981 and # 32573 all tests of VfpClient (https://github.com/tombrothers/VfpClient), which is used by the provider, passed successfully. I understood that there are other x86 fixes to be implemented, but with the implementations of these 2 issues they solve our problems 100% and would allow us to complete the EF Core provider for Fox Pro.

@jader1313
Copy link

People who are working on EntityFrameworkCore.Jet (CirrusRedOrg/EntityFrameworkCore.Jet#34) will probably need these implementations in 3.1 as well, as they should encounter the same errors. @FreddyD-GH @lauxjpn @bubibubi

@FreddyDgh
Copy link
Contributor

I'm noticing a lot of comments wanting these fixes in .NET 3.1. Not to speak for anyone else, but I believe what people really care about is having these fixes integrated AS SOON AS POSSIBLE, more so than the .NET Core 3.1 compatibility (it already has, as it's already a separate NuGet package that targets .NET Standard 2.0).

As mentioned, these bugs hit EntityFramework providers pretty hard if they rely on System.Data.OleDb. I think the main goal is to have EFCore 3.1 providers be unblocked on .NET Core PRIOR to the release of .NET 5 (as I assume there will be a coinciding EntityFramework Core release). If the EFCore 3.1 provider doesn't work BEFORE EFCore 5.0 is released, that's not exactly a great scenario for end users.

@saurabh500 I understand that your hesitation about not including this fix in your "servicing" release. However, is it possible that System.Data.OleDb could publish a "preview" release of the NuGet package at the same time? For example, push two package updates: version 4.7.1 (which does not contain this fix), and a version 4.8.0-preview1 (which DOES include the fix).

@ericstj
Copy link
Member

ericstj commented Mar 10, 2020

Nightly builds of this package are published out of master for anyone that would like to pick up changes. They will also be published to nuget.org following the .NET 5 release schedule (monthly previews).

You can see the nightly build here:https://dnceng.visualstudio.com/public/_packaging?_a=package&feed=dotnet5&package=System.Data.OleDb&protocolType=NuGet&version=5.0.0-preview.3.20160.5

@FreddyDgh
Copy link
Contributor

@ericstj Thanks, that information is helpful to know. Is there any good documentation where I can find out more about how the release schedule works? In particular, I'm a little confused when you say that that packages will be published to nuget.org as monthly previews, but it looks like there have been no preview packages for System.Data.OleDb in the last 4 months.

@lauxjpn
Copy link

lauxjpn commented Mar 10, 2020

While reading about this issue, I vaguely remembered that I stumbled over a similar exception some time ago. I wrote a little bit about it on StackOverflow two years ago. While I wrote at the time, that this is an ACE issue, it might could be an OLE DB related issue as well.

I was able to replicate it again today with EntityFramworkCore.Jet using the x64 Microsoft.ACE.OLEDB.16.0 OLE DB provider from the Microsoft Access Database Engine 2016 Redistributable.

I had no issues using the x64 Microsoft.ACE.OLEDB.12.0 OLE DB provider from the Microsoft Access Database Engine 2010 Redistributable.

@saurabh500 This might be worth looking into in conjunction with #32509.

Also I can only propose a servicing fix, but then the approvals are subject to quality bar and risk evaluation.

Let's cross our fingers (the risk evaluation bar is known to be high). Though in this case, users should not have been easily able to fix these issues by themselves, so an approval might be possible.
We would also be happy with a release of System.Data.OleDb that is independent of .NET Core's regular servicing cycle (System.Data.OleDb has its own NuGet package now after all).

@ericstj
Copy link
Member

ericstj commented Mar 10, 2020

it looks like there have been no preview packages for System.Data.OleDb in the last 4 months.

Right, the first preview for net5 hasn't shipped yet, it's underway but has not released. It's not as simple as just build/publish as things need to sync up with Visual Studio. If you want simple / fast, use the packages from the nightly build feed.

@leecow @jamshedd do you have any public facing docs around the schedule of net5 previews?

@FreddyDgh
Copy link
Contributor

@ericstj Ahhh, now I think I am understanding how it works. That is very unfortunate for the libraries that ship as separate NuGet packages. Regardless, thanks for clarifying.

@leecow
Copy link
Member

leecow commented Mar 11, 2020

Nothing public-facing at the moment. I'll work with the blog writing folks and perhaps work something into the Preview 1 post.

@jader1313
Copy link

@saurabh500 I think @FreddyD-GH idea of a nuget package of System.Data.OleDB 4.8 Preview would solve the issue.

@saurabh500
Copy link
Contributor

Yeah that has always been the plan. The changes will automatically ship in the next Nuget release for System.Data.OleDb.
Hence the next version bump to 4.8.0-preview-yyyyyy will have the changes. These updated packages are shipped with new releases of the runtime. However the nuget packages for System.Data.OleDb are not tied to the runtime and can be used with older runtimes also.

@lauxjpn
Copy link

lauxjpn commented Mar 11, 2020

However the nuget packages for System.Data.OleDb are not tied to the runtime and can be used with older runtimes also.

That should be good enough.

@ajcvickers ajcvickers removed the untriaged New issue has not been triaged by the area owner label Jun 23, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet