?
Solved

Append an open record

Posted on 2002-04-18
11
Medium Priority
?
164 Views
Last Modified: 2011-10-03
Hello,
I am trying to flag a record in an open Recordset that was opened as adOpenDynamic with a ADODB connection.  I have the cursor on the Active record that I want to append but the AddNew method gives me error 3251 "Object is not capable of performing the operation".  Is there a way to do it with the Recordset or will I have to write and issue a INSERT SQL statement?

Thanks for reading this!
0
Comment
Question by:Glowman
  • 6
  • 5
11 Comments
 
LVL 5

Expert Comment

by:rkot2000
ID: 6951062
can you post your rs.open code ?
0
 
LVL 4

Author Comment

by:Glowman
ID: 6951084
Us.Open SQL, Conn, adOpenDynamic

Where Us is a ADODB.Recordset and Conn is the connection to the active database.
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6951095
I need to see your sql. in somecases sql may produce a readonly recordset.
0
Technology Partners: 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!

 
LVL 5

Expert Comment

by:rkot2000
ID: 6951103
or you can try to add this :

Dim x As ADODB.Recordset
x.Open sql, con, adOpenDynamic, adLockOptimistic
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6951109
yep adLockOptimistic shoud work because :


adLockReadOnly (Default) Read-only—you cannot alter the data.
0
 
LVL 4

Author Comment

by:Glowman
ID: 6951113
OK. that got past that error.  Now what seems to be happening is that it is creating an entirely new record and I would like to just add a value to a field in the record that I am on.
0
 
LVL 4

Author Comment

by:Glowman
ID: 6951130
OK. that got past that error.  Now what seems to be happening is that it is creating an entirely new record and I would like to just add a value to a field in the record that I am on.
0
 
LVL 5

Accepted Solution

by:
rkot2000 earned 300 total points
ID: 6951131
to modify a field:
rs.field("xxx").value = rs.field("xxx").value + 25
rs.update

where xxx - your field name.
0
 
LVL 4

Author Comment

by:Glowman
ID: 6951142
Perfect. I don't know why I thought I had to AddNew but thanks for your great answers.
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6951143
rs.fields not rs.field
0
 
LVL 4

Author Comment

by:Glowman
ID: 6951153
Perfect. I don't know why I thought I had to AddNew but thanks for your great answers.
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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

840 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