views:

440

answers:

4

My Application (Vb.net, Access 2003/2007) is to scan Access Database files for activex controls and to generate report accordingly.

Problem:

Getting an error like:

"Insufficient memory to continue the execution of the program."

The above error occurs while scanning for older version of Access files like prior to office 2000.

And the line of code where I get this is as follows:

Dim oForm As Access.Form
Dim oAccess as Access.Application

oForm = oAccess.Forms(objForms.Name)

But it opens the file and form as well.

Need Help:

Whether it is possible to read the file (Access Forms and Reports) or not?

Please provide me reference or any solution.

A: 

I've seen behaviour very similar to this before. Access 97 files will sometimes report an 'out of memory' error if you try to open them on a computer with more than (I think) 1Gb of RAM. The error doesn't always manifest itself immediately - sometimes the project can appear to run normally but crash when you try to open a particularly large object.

In the case where we did run into this the users were running an old Access 97 database on new XP machines they'd been upgraded to with modern amounts of RAM. Tech support for the company tried everything they could think of - including complete office reinstalls, applying all patches etc. but eventually had to resort to removing RAM from the computers - whereupon the errors went away and everything was rock solid again. I am uncertain as to the exact cause, but it will be connected with memory management in the Access 97 file format (I believe the error is on MSDN somewhere but I wasn't directly involved with Tech support hunting the solution down - I'd just written the application many years before)

I'd suggest you're only way out is to use a special, low memory, PC to run the application.

Cruachan
Actually the 1 Gb of RAM problem with Office 97 would've been solved with Jet 3.51 "Out of memory" error starting Microsoft Access (97) http://support.microsoft.com/?kbid=161255. Which is a good idea anyhow as Jet is stabler.
Tony Toews
A: 

This set of posts may be of help: http://www.vistax64.com/vista-general/64712-access-out-memory.html

Remou
A: 

You appear to doing COM automation of Access to open the forms and then cycle through their controls looking for certain properties.

Another solution would also involve automating Access, but it wouldn't require actually opening the form, and that's the undocumented Application.SaveAsText command. You'd do something like this:

  Application.Saveastext acForm, "dlgWebBrowser", _
    "C:\Output\dlgWebBrowser.txt"

You would then have to figure out how ActiveX controls are described in that file. If that file looks like the code for a VB form, that's because that's precisely what it is.

The example above had an IE web browser control on it, and after a dump of OLE data, it had this in it:

  OLEClass ="Microsoft Web Browser"
  Class ="Shell.Explorer.2"
  GUID = Begin
    0x54c1ea41936d2046b9dc5b29905976e3
  End

I would expect that all ActiveX controls will have an OLEClass, but I non-native avoid ActiveX controls on principle because of the problems they can cause if not properly installed when you try to run the app.

In fact, that could be the source of the problem -- if you open the Access form on a machine that doesn't have the relevant ActiveX control registered, it's going to fail, and the form won't open.

My bet is that Application.SaveAsText is going to sidestep that problem entirely, since the form doesn't have to be opened.

David-W-Fenton
A: 

How many forms are already open, when that error occurs?
Are you closing the form, once you are done processing it?

shahkalpesh