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
Solved

Append an open record

Posted on 2002-04-18
11
154 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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
VBA saving file message display 5 72
message box in access 4 51
Prevent user closing word document opened with VB6 6 78
VB6 ListBox Question 4 48
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

839 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