Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

There isn't enough free memory to update the display. 1

Status
Not open for further replies.

jrollins

MIS
May 7, 2003
24
0
0
US
I was using DoCmd.SendObject to send e-mails from Access. It performed erratically and I discovered it's a known bug. Following the instructions in MS Knowledge Base Article - 209948, I switched to using Automation to send the e-mails. It worked fine but I soon started getting the error message 'There isn't enough free memory to update the display. Close unneeded programs and try again.' I reinstalled Office 2000, applied SR1/SR1-A, installed SP3 for Office 2000, and increased the size of my PageFile. Nothing stops the error. Anybody got an idea?
 
have you tried bumping up the virtual memory?
 
Are you using some sort of Do Loop statement to send the emails. If so, check to see that you are not Defining a variable over and over again in your code. In other words, dont define any variable inside your Do/Loop statement
 
I copied the following code directly from MS Knowledge Base Article - 209948. I only call the sub SendMessage one time when a user changes the value in a combo box.

Public objOutlook As Outlook.Application
Public objOutlookMsg As Outlook.MailItem
Public objOutlookRecip As Outlook.Recipient
Public objOutlookAttach As Outlook.Attachment
Public DLEC_TO As String
Public DLEC_CC As String
Public DLEC_SUBJECT As String
Public DLEC_MESSAGE As String

Public Sub SendMessage(Optional AttachmentPath)

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add(DLEC_TO)
objOutlookRecip.Type = olTo

' Add the CC recipient(s) to the message.
' Set objOutlookRecip = .Recipients.Add(DLEC_CC)
' objOutlookRecip.Type = olCC

' Set the Subject, Body, and Importance of the message.
.Subject = DLEC_SUBJECT
.Body = DLEC_MESSAGE & vbCrLf & vbCrLf
.Importance = olImportanceHigh 'High importance

' Add attachments to the message.
'If Not IsMissing(AttachmentPath) Then
' Set objOutlookAttach = .Attachments.Add(AttachmentPath)
'End If

' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next
MsgBox "INSIDE SendMessage BEFORE .Send"
.Send
MsgBox "INSIDE SendMessage AFTER .Send"
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
 
jrollins

Oh man, this seems nasty.

From a hardware perspective, there are two possible issues...

A memory leak
A program is not releasing some or all the resources after closing. This is a type of bug, and has to be fixed by the vender. Can anyone spell Word 95 times ;-)

A program or such not being closed
A program session or an activity is being opened and not closed.

You probably want to determine which...
- Task manager may show more than one session running. (Sigh, I wish systems were more like Unix)
- Trace your code. See if the API is being called more than expected. (I see by the MsgBox, you are already working on this)
- Look for other activies in the form that may be hogging resources. For example, not closing record sets.

Also,
Check for system updates at Microsoft...


Richard
 
my guess is the objOutlook is causing the problem. I have never used the Outlook.Application variable before, but my guess is you need to have something like objOutlook.quit at the end of your code before you set the object to nothing. Bellow is a snipit from your code. In red is where you might try the .quit method.
__________________________
...
MsgBox "INSIDE SendMessage BEFORE .Send"
.Send
MsgBox "INSIDE SendMessage AFTER .Send"
End With
Set objOutlookMsg = Nothing
objOutlook.quit
Set objOutlook = Nothing
End Sub
________________________________________

Like I said i have never tried this before, but it may help. Good luck

GTLoco
 
I agree that objOutlook is causing the problem. This database is on the LAN and every workstation that opens it gets the same error at the same point. I tried the objOutlook.quit suggestion but it didn't work. One curiosity: If you're on SR1-A or SP3, you get a security warning when you try to fire an e-mail using one of the VBA methods. When I try to send an e-mail using Automation to a single recipient, I have to click through six of those security dialog boxes.
 
jrollins

While reviewing another issue, I came across some interesting articles on Microsoft's web site, and other sites slightly related to your problem...

The following link is for a member who noticed that Access was not closing after exiting
thread702-673193 this example, a second instance of Access is opened and can not be closed. I have to wonder if this is what is happening with OutLook -- not being closed.

Try adding...

objOutlook.Visible = True

...to your code and see if the OutLook object remains visible, or if it closes. I am hoping that this will confirm if OutLook is being closed for each session, or remaining open.

Richard
 
If you're on SR1-A or SP3, you get a security warning when you try to fire an e-mail using one of the VBA methods
__________________________________

Yes, this was a security update Microsoft added to keep automactic emails from being sent by a virus without the user knowing about it. I still have not found where you can turn it off either.

GTLoco

Disclaimer: If my spelling sucks, its because i still need more coffee
 
FYI I finally fixed this problem my making my forms 'skinnier' (fewer graphics and controls, fewer forms open simultaneously. Apparently, Outlook 2000 doesn't manage GDI memory very well. My original code and forms execute perfectly in Outlook 2002. Microsoft has no fix for this problem in Outlook 2000 except for putting your database on a memory diet.
 
Star for you on sharing your resolution.

(Under a Cool Tips thread, a while back, numerous postings suggested the use of graphics to add pizzaz. I was the odd man out in suggesting to keep the application thin in favour of performance.)

Hopefully, Microsoft will address this apparent leak.

Richard
 

Please keep an open mind on this...
Is your application complete? Did you try it on another machine?
Here is what fixed it for me (the key was in the error message "...unable to update the display...". Ah! GDI!
Try updating your video card drivers. Don't laugh... it worked swimmingly for me!
Please post if it has helped. My suspicion is that a recent update trashed something very miniscule in the display subsystem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top