Solved

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

Posted on 2011-02-17
2
968 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
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article will show you how to use shortcut menus in the Access run-time environment.
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now