[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2011-02-17
2
Medium Priority
?
1,015 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
1 Comment
 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

834 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