Solved

Append an open record

Posted on 2002-04-18
11
155 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 75 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS Access - Capture pressed key onclick 4 43
Modifying Conditional Format from VBA code 3 69
Macro Excel - Multiple If conditions 2 87
RUNRMTCMD from AS/400 12 86
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

685 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