?
Solved

Update failed on recordset

Posted on 2007-03-30
3
Medium Priority
?
256 Views
Last Modified: 2012-06-27
I am using ADO recordset. When I use AddNew method and Update to add new record, the program crash everytime on the update method.
This the error message that show up:
"The instruction at "0x7c9111de" referenced memory at "0x005f0054". The memory could not be "read".
Please help.

Here is sample code:
Set NewAdd_RS_IOF = public_RS_IOF.Clone
NewAdd_RS_IOF.Fields("USER1_VALUE") = USER1_VALUE
NewAdd_RS_IOF.Fields("USER2_VALUE") = USER2_VALUE
NewAdd_RS_IOF.Update
0
Comment
Question by:doughboy03
[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
3 Comments
 
LVL 15

Expert Comment

by:JackOfPH
ID: 18828009
If you are using Access Try using this connection string.
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;
0
 
LVL 15

Expert Comment

by:JackOfPH
ID: 18828014
Try using the Microsoft.Jet.OLEDB.4.0
instead of Microsoft.Jet.OLEDB.3.51
0
 
LVL 32

Accepted Solution

by:
Robberbaron (robr) earned 1000 total points
ID: 18828029
have you tried using test text data for the new values.Just to make sure it's not the data causing the DataAccess object to crash.

Set NewAdd_RS_IOF = public_RS_IOF.Clone
NewAdd_RS_IOF.Fields("USER1_VALUE") = "my name"
NewAdd_RS_IOF.Fields("USER2_VALUE") = "your name"
NewAdd_RS_IOF.Update

check the format of the fields..... I've had problems where a string was larger length than field and it caused a non-trappable error.  Not as catastrophic as your error though!

try reading the new data before update also. Does it match ?
MsgBox NewAdd_RS_IOF.Fields("USER2_VALUE")
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month13 days, 22 hours left to enroll

801 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