473,395 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

0xC0000005: Access violation reading location

I receive this message under certain conditions:

1. "Unmanaged Code Debugging" is checked in Property Pages.
2. Certain routines are "stressed." The error does not appear unless loops
are repeated many times.

I'm using Net Framework 1.1. I found a confirmed bug in Online Technical
Support (Article ID : 811193), but the workaround applies only to C++.

What is the significance of this error? More importantly, can I/should I do
anything about it?

Any suggestions would be most appreciated.
--
Fred de Picciotto
Nov 21 '05 #1
3 7057
"Fred" <Fr**@discussions.microsoft.com> schrieb:
I receive this message under certain conditions:

1. "Unmanaged Code Debugging" is checked in Property Pages.
2. Certain routines are "stressed." The error does not appear unless
loops
are repeated many times.

I'm using Net Framework 1.1. I found a confirmed bug in Online Technical
Support (Article ID : 811193), but the workaround applies only to C++.

What is the significance of this error? More importantly, can I/should I
do
anything about it?


Can you post some code that causes this error?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2
Herfried,

Thanks for replying so quickly.

Without getting into too much detail, I'm putting 2 Excel ranges into two
separate 2-dimensional Object arrays, then doing some comparisons and
manupulations. (Afterward, the put the arrays back into Excel. I found this
works MUCH faster than accessing Excel ranges repeatedly.) The code that
seems to initiate the problem is:

If liMRows > 1 AndAlso liDRows > 1 Then

' Arrays are zero-based. By starting with 1, we skip the headers.
For I = 2 To liMRows
For J = 2 To liDRows
If (Not lxDetailArRet(J, liForeignKeyCol) Is Nothing) AndAlso (Not
lxMasterArRet(I, 1) Is Nothing) AndAlso (Not lxMasterArRet(I, liDescrCol) Is
Nothing) Then
lsDetailVal = lxDetailArRet.GetValue(J, liForeignKeyCol).ToString
lsMasterVal = lxMasterArRet.GetValue(I, 1).ToString
lxSubstituteVal = lxMasterArRet.GetValue(I, liDescrCol)
If lsDetailVal = lsMasterVal Then
lxDetailArRet.SetValue(lxSubstituteVal, J, liForeignKeyCol)
End If
End If
Next
Next

End If

(Pasting code into this box is a bear. I apologize for the way it looks...)

When the number of loops is small (e.g., up to 50) I don't see the error.
When, however, large Excel ranges are involved (16,000+ rows) I see the error
repeatedly. Despite this, the routine completes and the data seems get
transferred correctly.

Thanks in advance, Fred de Picciotto

"Herfried K. Wagner [MVP]" wrote:
"Fred" <Fr**@discussions.microsoft.com> schrieb:
I receive this message under certain conditions:

1. "Unmanaged Code Debugging" is checked in Property Pages.
2. Certain routines are "stressed." The error does not appear unless
loops
are repeated many times.

I'm using Net Framework 1.1. I found a confirmed bug in Online Technical
Support (Article ID : 811193), but the workaround applies only to C++.

What is the significance of this error? More importantly, can I/should I
do
anything about it?


Can you post some code that causes this error?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
I found the source of the error, but don't know how to fix it.

The source is running a DTS package written in VB.Net. I created the
package using Enterprise Manager and converted it over to .Net (I followed
the tutorial that can be found at:

http://www.devguru.com/features/tuto...VB/DTS_VB.html

Unfortunately, although it runs correctly most of the time, I'm afraid it
causes intermittent failures (my program runs the DTS on 71 tables, some of
them with over 15,000 rows).

I don't know what I'm doing wrong, but any help would be greatly appreciated!

"Fred" wrote:
Herfried,

Thanks for replying so quickly.

Without getting into too much detail, I'm putting 2 Excel ranges into two
separate 2-dimensional Object arrays, then doing some comparisons and
manupulations. (Afterward, the put the arrays back into Excel. I found this
works MUCH faster than accessing Excel ranges repeatedly.) The code that
seems to initiate the problem is:

If liMRows > 1 AndAlso liDRows > 1 Then

' Arrays are zero-based. By starting with 1, we skip the headers.
For I = 2 To liMRows
For J = 2 To liDRows
If (Not lxDetailArRet(J, liForeignKeyCol) Is Nothing) AndAlso (Not
lxMasterArRet(I, 1) Is Nothing) AndAlso (Not lxMasterArRet(I, liDescrCol) Is
Nothing) Then
lsDetailVal = lxDetailArRet.GetValue(J, liForeignKeyCol).ToString
lsMasterVal = lxMasterArRet.GetValue(I, 1).ToString
lxSubstituteVal = lxMasterArRet.GetValue(I, liDescrCol)
If lsDetailVal = lsMasterVal Then
lxDetailArRet.SetValue(lxSubstituteVal, J, liForeignKeyCol)
End If
End If
Next
Next

End If

(Pasting code into this box is a bear. I apologize for the way it looks...)

When the number of loops is small (e.g., up to 50) I don't see the error.
When, however, large Excel ranges are involved (16,000+ rows) I see the error
repeatedly. Despite this, the routine completes and the data seems get
transferred correctly.

Thanks in advance, Fred de Picciotto

"Herfried K. Wagner [MVP]" wrote:
"Fred" <Fr**@discussions.microsoft.com> schrieb:
I receive this message under certain conditions:

1. "Unmanaged Code Debugging" is checked in Property Pages.
2. Certain routines are "stressed." The error does not appear unless
loops
are repeated many times.

I'm using Net Framework 1.1. I found a confirmed bug in Online Technical
Support (Article ID : 811193), but the workaround applies only to C++.

What is the significance of this error? More importantly, can I/should I
do
anything about it?


Can you post some code that causes this error?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: batista | last post by:
Hi, I am getting the following exception First-chance exception in TestMansoor.exe: 0xC0000005: Access Violation When i run the following code 1 int main(void) 2 {
2
by: bhreddy | last post by:
Hi All, Can someone help me out how can I resolve the error "0xC0000005: Access violation reading location 0x513112f4"? Steps I followed... 1. I ran the application at DOS prompt 2. After...
1
by: Yanping Zhang | last post by:
Here are more details about my codes, please help! The function declared in C: typedef void (WINAPI *PLEARNCALLBACKPROC) (unsigned int progress, unsigned int sigQuality, unsigned long...
1
by: John Todd | last post by:
Hi, all. I've been working on a .NET project written in C# for the past three months. Yesterday, all of a sudden, I get The application failed to initialize properly (0xc0000005) error when i...
0
by: vve | last post by:
I'm discovering a strange behaviour in an C# project using ZedGraph (https://sourceforge.net/projects/zedgraph/). After adding a signal to it, it seems that the clr goes mad for some reason. I...
5
by: Tomas Vera | last post by:
Hello All, I have an app that is running throughout my company with one exception. Recently, one employee started throwing exception 0xC0000005 on startup. Specifically, it's crashing out...
1
by: ritvik | last post by:
hi all can anyone please help me with this error.code was working properly earlier giving appropritae results before addign the functions : assign_ordersize(); user_data.printodsize(); this is...
13
by: ycinar | last post by:
A quick question: Why doesn't the following code catch the Access violation reading location exception? it crashes on line if ( xyz ) with an Access violation reading location exception. Is not...
3
by: Pinux | last post by:
Hi, I am writing a multi-threads encryption application. The idea of the code is to create a number of threads to encrypt files. I have a thread pool say the maximum threads is 10. If the number...
2
by: =?Utf-8?B?c29jYXRvYQ==?= | last post by:
Hi, I have a DLL in VC6, when a specific function is called it will spawns a few threads and then return. The threads stay running and inside one of these threads an event is created using the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.