OLEDB error E_OUTOFMEMORY (0x8007000E) while trying to insert into Access Database from c#

-1

I just wanted to post my question / solution to a deep problem we just encountered and solved.

I didn't find any direct answer on the internet except a CLUE here : http://members.iiug.org/forums/ids/index.cgi/noframes/read/2476

Big picture, we have an old WinForm (c#) application running for one of our clients. the application is connecting to an MS Access Database (2007 format, beeing MyDatabase.accdb). The application was running JUST FINE for the last YEARS! This morning, the customer called me saying there was the error shown in the Question Title. the error was occuring when trying to insert into a TABLE.

The connection string is quite simple : 'Provider=Microsoft.Ace.OLEDB.12.0;Data source=Path\MyDatabase.accdb'

I suspect a Windows Update that crashed my application...

c#
ms-access-2010
oledbcommand
asked on Stack Overflow Feb 10, 2020 by Simon

1 Answer

0

LONG STORY SHORT (3 hours of deep investigation, of trial and error, etc...) : there was like 40 columns in the table. all the 'IDs' were 'Long Integer' in Access, and the insertion was made with a OleDbCommand, with tons of parameters. the Parameters for the 'Long Integer' were OleDbType.BigInt. No IDs were bigger than 1000....

Solution : i've just changed the OleDbType to OleDbType.Integer, and everything worked.

answered on Stack Overflow Feb 10, 2020 by Simon

User contributions licensed under CC BY-SA 3.0