Reputation: 1
My C# app occurred 'Access Violation Exception' when calling ADODB connection 'get_state()'. Not always, just once.
What does this app do is, Delete all data from a table & Insert data into the same table. Keep running the task in WhileLoop, waiting 10 sec after each task. It's running in a single task.
Delete & Insert are in same transaction because we need to Delete old data only when new data Insert will be done successfully.
Built option: 'AnyPCU'.
Database: SQLserver Express 2014.
ADODB connection variable is not static.
Exception code: 0xc0000005
Offset: 0x000b55bc
Module path: C:\Program Files (x86)\Common Files\System\Ole DB\sqloledb.dll
StackTrace:
System.AccessViolationException
Place: ADODB.ConnectionClass.get_State()
This app has to run continuously so as an workaround I am planning to add a code to catch the Access Violation Exception so the app won't crash. I also will change ADODB connection variable to 'static' to make the usage serially.
But I need to find why it's happening to decide if this workaround is fine or not.
Upvotes: 0
Views: 93