Solved

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

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This article will show you how to use shortcut menus in the Access run-time environment.
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
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 …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

815 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

8 Experts available now in Live!

Get 1:1 Help Now