473,378 Members | 1,493 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,378 software developers and data experts.

memory could not be "written" when application terminates

Hello,

I have written an application in Visual Basic 6.0 Professional SP5 that
reads data from an Excel workbook by using ADO. When I close the
application, I get the error:

'The instruction at "0x01b302bd" referenced memory at "0xb52ad202". The
memory could not be "written"'

- this only happens with the compiled exe (both P-code and native code), but
not when I run the application in Visual Basic without compiling
- this only happens if the application has read data from the Excel workbook
- this happens with Windows 98se, Windows NT 4 and Windows XP

I'm using the MS ActiveX Data Object 2.7 Library.

Does someone has a clue what might cause the error?

Thanks in advance,

Geert-Pieter
Jul 17 '05 #1
5 21964
"Geert-Pieter Hof" <g.*******@wbmt.tudelft.nl.blablabla> wrote in message news:<bi**********@azure.qinip.net>...
Hello,

I have written an application in Visual Basic 6.0 Professional SP5 that
reads data from an Excel workbook by using ADO. When I close the
application, I get the error:

'The instruction at "0x01b302bd" referenced memory at "0xb52ad202". The
memory could not be "written"'

- this only happens with the compiled exe (both P-code and native code), but
not when I run the application in Visual Basic without compiling
- this only happens if the application has read data from the Excel workbook
- this happens with Windows 98se, Windows NT 4 and Windows XP

I'm using the MS ActiveX Data Object 2.7 Library.

Does someone has a clue what might cause the error?

Thanks in advance,

Geert-Pieter


It is likely that there are some object references left which VB can't
take care of. Try looking for circular references (Object A refers to
Object B and vice versa, or something similar) and break them by
explicitly setting the objects to Nothing. Note that Class_Terminate
or Form_Terminate event won't arrive in such a case, so you have to
remove the references earlier.

Robert
Jul 17 '05 #2
> I have written an application in Visual Basic 6.0 Professional SP5 that
reads data from an Excel workbook by using ADO. When I close the
application, I get the error:

'The instruction at "0x01b302bd" referenced memory at "0xb52ad202". The
memory could not be "written"'

- this only happens if the application has read data from the Excel

workbook

Problem solved!

The problem was a 3rd party component (Vertical Menu ActiveX Control from
WinResources) that had to be set back to its initial state before closing
the application. Altough this component has absolutely nothing to do with
reading and writing the Excel workbook via ADO, the 'memory could not be
"written"'-message only showed up after accessing the Excel workbook.

One last question:
The problem I had, is this an imperfection of the 3rd party component or of
Visual Basic 6.0?

Best regards,

Geert-Pieter
Jul 17 '05 #3
hex
"Geert-Pieter Hof" <g.*******@wbmt.tudelft.nl.blablabla> wrote in message news:<bj**********@azure.qinip.net>...
I have written an application in Visual Basic 6.0 Professional SP5 that
reads data from an Excel workbook by using ADO. When I close the
application, I get the error:

'The instruction at "0x01b302bd" referenced memory at "0xb52ad202". The
memory could not be "written"'

- this only happens if the application has read data from the Excel

workbook

Problem solved!

The problem was a 3rd party component (Vertical Menu ActiveX Control from
WinResources) that had to be set back to its initial state before closing
the application. Altough this component has absolutely nothing to do with
reading and writing the Excel workbook via ADO, the 'memory could not be
"written"'-message only showed up after accessing the Excel workbook.

One last question:
The problem I had, is this an imperfection of the 3rd party component or of
Visual Basic 6.0?

Best regards,

Geert-Pieter


We receive the same error from a similar application we have under
development and using the same control from WinResources. I'd be very
interested in what was done to eliminate this error. Any information
you have regarding what you had to do to set the control back to its
initial state would be of great help.

Thanks in advance for your help,

Andy
Jul 17 '05 #4
> > > I have written an application in Visual Basic 6.0 Professional SP5
that
reads data from an Excel workbook by using ADO. When I close the
application, I get the error:

'The instruction at "0x01b302bd" referenced memory at "0xb52ad202". The memory could not be "written"'
Problem solved!

The problem was a 3rd party component (Vertical Menu ActiveX Control from WinResources) that had to be set back to its initial state before closing the application.
We receive the same error from a similar application we have under
development and using the same control from WinResources. I'd be very
interested in what was done to eliminate this error. Any information
you have regarding what you had to do to set the control back to its
initial state would be of great help.


Private Sub Form_Unload(Cancel As Integer)

VerticalMenu1.MenuItemsMax = 0
VerticalMenu1.MenusMax = 0

End Sub

Putting these two lines of code in the Form_Unload will prevent the memory
could not be "written"-problem while unloading the Vertical Menu control.

Best regards,

Geert-Pieter
Jul 17 '05 #5
hex
"Geert-Pieter Hof" <g.*******@wbmt.tudelft.nl.blablabla> wrote in message news:<bj**********@azure.qinip.net>...
> I have written an application in Visual Basic 6.0 Professional SP5 that > reads data from an Excel workbook by using ADO. When I close the
> application, I get the error:
>
> 'The instruction at "0x01b302bd" referenced memory at "0xb52ad202". The > memory could not be "written"' Problem solved!

The problem was a 3rd party component (Vertical Menu ActiveX Control from WinResources) that had to be set back to its initial state before closing the application.

We receive the same error from a similar application we have under
development and using the same control from WinResources. I'd be very
interested in what was done to eliminate this error. Any information
you have regarding what you had to do to set the control back to its
initial state would be of great help.


Private Sub Form_Unload(Cancel As Integer)

VerticalMenu1.MenuItemsMax = 0
VerticalMenu1.MenusMax = 0

End Sub

Putting these two lines of code in the Form_Unload will prevent the memory
could not be "written"-problem while unloading the Vertical Menu control.

Best regards,

Geert-Pieter

We'll add the code you have listed.

Many thanks for the assistance!

Andy
Jul 17 '05 #6

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

Similar topics

10
by: Avinash | last post by:
Hi, I have written an application in VC 6.0. I have allocated some memory using new operator. 1.When i use new operator is the memory allocated from process heap? If it is allocated from...
1
by: Pablo | last post by:
Hi, there, I have a simple MS ACCESS application. It supposes to print one report. It works fine in my computer, it also works fine in some other computers, but it stops working in one of the...
17
by: dingoatemydonut | last post by:
The C99 standard states: "In the abstract machine, all expressions are evaluated as specified by the semantics. An actual implementation need not evaluate part of an expression if it can deduce...
1
by: Haitao | last post by:
I encountered this error message when running my C program for over 2 hours. When it runs only for a short time, there is no problem at all. Anybody can give me an idea on what might have caused such...
62
by: ivan.leben | last post by:
How can I really delete a preloaded image from memory/disk cache? Let's say I preload an image by creating an Image object and setting its src attribute to desired URL: var img = new Image();...
3
by: mabubakarpk | last post by:
I am facing problem when I open vb6.0 exe file. I make programe in vb6.0 and I deploy its exe in different computers when I open this exe file it gives me message. "The Instruction at "0x2682bacf"...
17
by: Mike | last post by:
Hello, I have following existing code. And there is memory leak. Anyone know how to get ride of it? function foo has been used in thousands places, the signature is not allowed to change. ...
9
by: Bruno Barberi Gnecco | last post by:
I'm using PHP to run a CLI application. It's a script run by cron that parses some HTML files (with DOM XML), and I ended up using PHP to integrate with the rest of the code that already runs the...
30
by: GeorgeRXZ | last post by:
Hi Friends, I have some questions related to C Language. 1What is the difference between the standard C language and Non standard C language ? 2which is better C Lanugage, C under Linux/...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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...

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.