MSAccess, Some OLE loaded files will not save, not enough memory

John Schuster 1 Reputation point
2021-01-21T02:33:01.487+00:00

I have a form with a Bound OLE Object to a varbinary(max) field in a linked SQL Server table.

This is being used to load PPTX, XLSX, DOCX, PDF files into the varbinary field.

I know this isn't the best solution for document management but it's what I got for this project.

I use the ole-object right-click, insert object..., create from file, browse... to the file and click on OK to load the file into the OLE Object.

All of the files will load into the ole control and display properly.

58859-image.png

All of the files will allow for 'Open' or 'Show' them.

A few of the files when saving them will get a "Not enough memory to complete the Automation object operation on the Presentation object" and the save will abort. In this example the file being loaded was a PowerPoint PPTX file. After that error a "Sorry, an unexpected error has occurred, please exist and restart..." occurs

If I close the form and reopen it I can load and save any file that previously loaded with no error. But if I attempt the record save with one of these known to fail, the record save fails again.

There is no code behind the form events including load, current, before_Update and after_update.

I've tried quite a few approaches

Renaming file
Putting the file in different directory
Opening the PPT or XLSX and resaving under a new name
Just Small files 1.9MB
Just Large files 19.1 MB
Relinking the SQL Server linked table
Some others I can't remember
My Google-foo has not been good in the research.

Any suggestions or direction is greatly appreciated.

Stay Safe

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,684 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. C Data 6 Reputation points
    2021-01-22T15:02:11.457+00:00

    you have to down size those files. some years past when I use to use this method we had pics of people in an HR app...and at some point in time whomever was making those pics changed to a very large file size and this problem developed.... we were able to mass downsize the pic format...

    I can't remember if it is the individual file size - or the accumulated... if it is the accumulated you may be able to segment how much data loads some how...

    but as you probably know - the files should be held outside in folders, and one should only window static image files inside an Access object. attempting to window an entire application (adobe, powerpt) inside an Access object is not viable in my opinion....

    0 comments No comments

  2. GeekMustHave 1 Reputation point
    2021-01-22T17:43:50.603+00:00

    Thank you for the advice. I have been reminded by many others much smarter than me, that saving documents in the database in a BLOB or Varninary(Max) is NOT the best practice.

    The client has a strange security policy of not saving document files on the Azure file system.

    This solution with OLE has been working very well for many of the document files loaded, over 300 documents PPTX, DOCX, XLSX, PDF, BMP, TXT, CSV

    The documents that have successfully loaded are in the size range in size from 800kb to 19.1 MB.

    The collection of documents (PDF, PPTX, XLSX) that will not save are in varying sizes and there is no way to size down a Powerpoint presentation or an Excel spreadsheet. I can't save ZIP files in the OLE object because the is no OLE Server for ZIP files. I can't save PNG files for the same reason.

    Just for grins, I added a MsgBox to the Before_Update event on the form. When I move to the next record (Write the record out) this MsgBox never gets called.

    Thank you for your time.

    0 comments No comments