Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Update failed on recordset

Posted on 2007-03-30
3
Medium Priority
?
257 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

Industry Leaders: 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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

604 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