Solved

Out of memory error (7) when calling save method of ADO recordset object

Posted on 2011-02-17
2
985 Views
Last Modified: 2012-05-11
I am getting an out of memory run-time error '7' when I call the save method of the ADO Recordset object. I have tried this using VBA code in Excel and Access and I get the same error. I have also tried using ADO 2.6 and 2.8 and I get essentially the same error. I have also tried connecting to MSAccess database and Visual Foxpro database and I get the same error. However I do not get an error when saving changes in Access or Foxpro when using direct access or ODBC. Please could you help me resolve this problem? It's driving me nuts! I have managed to reduce the code below to the most basic version I can to reproduce the error. My machine is running Windows XP Pro SP3 and I am using Office 2007.
Sub Test1()

    Dim connAdo As ADODB.Connection
    Dim rstTest As ADODB.Recordset
    
    Set connAdo = New ADODB.Connection
    connAdo.Open ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\develop\database3.accdb;Persist Security Info=False;")
    
    Set rstTest = New ADODB.Recordset
    rstTest.Open "table1", connAdo, adOpenDynamic, adLockPessimistic
    rstTest.MoveFirst
    
    rstTest.Fields("field1").Value = "Test"
    rstTest.Save   '' THIS LINE CAUSES RUNTIME ERROR
    
End Sub

Open in new window

0
Comment
Question by:Caltor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
Caltor earned 0 total points
ID: 34922315
Don't worry; I've sorted it!
Should be rstTest.Update NOT rstTest.Save
Doh! The hours I've wasted on this.....
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My experience with Windows 10 over a one year period and suggestions for smooth operation
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question