cancel
Showing results for 
Search instead for 
Did you mean: 

C0000005 error caused by a buffer overrun while updating DB using OLEDB

GG
Level 3

We use Common - OLEDB - ExecuteQuery, with an update query. This causes ,  memory error, specifically, a C0000005 error is an access violation error caused by a buffer overrun. What could be the solution to this ? Is there any alternative to this ?



------------------------------
Gnana Gracy Antony Santiago Raj
Developer
BNP
------------------------------
Gracy
16 REPLIES 16

PvD_SE
Level 12

Hi Gnana,

If you could describe what you're trying to do, then we can have a look at either improving it or finding an alternative.



------------------------------
Happy coding!
---------------
Paul
Sweden

By all means, do not mark this as the 'Best answer'!

------------------------------

Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

Hi Paul,

The process reads data from an Excel file, it runs a query to exclude some of this data from the main update to the database. This is what we do. Since the no. of records have exceeded 5000 with 20 fields per row, this error occurred.

Thanks

GG



------------------------------

Developer
BNP
------------------------------

Gracy

Hi G,

5k rows is not much, not even for 20 columns. OLEDB should be able to handle this without any problems.

  • How much does the selection exceed 5k rows?
  • Does the error also occur if you only try to get a few rows with the SQL?
  • What does your SQL look like?


------------------------------
Happy coding!
---------------
Paul
Sweden

By all means, do not mark this as the 'Best answer'!

Off duty:
https://plusservices.se/my books/
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

Hi Paul, The sql query is this 

"UPDATE [Sheet1$] SET [Sheet1$].[IGNORE] = 'T' WHERE [Sheet1$].[AGREEMENT ID] = '" & [Agreements To Exclude Collection.AGREEMENT ID] & "'".

We hve not checked with the few rows. 



------------------------------
Gracy
------------------------------
Gracy

Hi Gracy,

I don't think you'll be needing to repeat the [Sheet1$] on each part of the SQL. So I reckon the following should do:
"UPDATE [Sheet1$] SET [IGNORE] = 'T' WHERE [AGREEMENT ID] = '" & [Agreements To Exclude Collection.AGREEMENT ID] & "'".

On the other hand it seems the use of ' and " in the SQL do not really add up. You may have a look at that.



------------------------------
Happy coding!
---------------
Paul
Sweden

(By all means, do not mark this as the 'Best answer'! )
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

Hi Paul, We are still stuck up with the above query and get the error. Is there anything else you feel not quite right here ? 

Internal : Could not execute code stage because exception thrown by code stage: No value given for one or more required parameters.

Thanks,

GG



------------------------------
Gracy
------------------------------
Gracy

The quotes seems to be right, the expression evaluates to 

UPDATE [Sheet1$] SET [IGNORE] = 'T' WHERE [AGREEMENT ID] = '709392' (Text)



------------------------------
Gracy
------------------------------
Gracy

Hi Paul,

Any updates on this please ?

-GG



------------------------------
Gracy
------------------------------
Gracy

Hi

I gave try from my end with same query , it is working with only modification done is removed single quote for number

UPDATE [Sheet1$] SET [IGNORE] = 'T' WHERE [AGREEMENT ID] = 709392

30377.png

Created dummy data with same column names

Regards



------------------------------
Lakshmi Narayana
------------------------------