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

x
?
Solved

Oracle, RDO Updateable RS and .AddNew

Posted on 1999-01-14
8
Medium Priority
?
218 Views
Last Modified: 2012-05-05
Greetings,
I'm having a little problem with an Updateable  RDO
resultset (rdOpenKeySet, rdrdConcurBatch). My .Update and .BatchUpdate work fine for Updates.
My .AddNew & .Update work fine for Adds but when I try to .BatchUpdate after an .AddNew has occurred I receive the following error:
 
Client Cursor:20 Cannot perform Update with an empty row.

Here is my Add code(the top portion is because there is a join in the rs):

rsPromoCust("TypeID").SourceTable = "TypePromotions"
rsPromoCust("TypeID").KeyColumn = True
rsPromoCust("PromotionID").SourceTable = "TypePromotions"
rsPromoCust("PromotionID").KeyColumn = True
rsPromoCust("DeActivatedOn").SourceTable = "TypePromotions"
rsPromoCust("StartDate").SourceTable = "TypePromotions"
rsPromoCust("EndDate").SourceTable = "TypePromotions"
   
rsPromoCust.AddNew
rsPromoCust("TypeID") = "" & CustDetail & ""
rsPromoCust("PromotionID") = "" & Promo & ""
rsPromoCust("StartDate") = Format(StartDate, "DD-MMM-YY")
rsPromoCust("EndDate") = Format(EndDate, "DD-MMM-YY")
rsPromoCust("TypeID") = "" & CustDetail & ""
rsPromoCust.Update

Any help would be appreciated.

Thanks,
Brad
0
Comment
Question by:bhummel
[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
  • 4
  • 4
8 Comments
 
LVL 10

Accepted Solution

by:
caraf_g earned 300 total points
ID: 1456256
After you've done the .AddNew, you are actually not positioned at the record you've just added. You're not positioned on anything at all.

So you'll have to create a new result set to retrieve the record you've just added so that you can then update it.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1456257
Having said that... why don't you just move the code after the .AddNew to before the .AddNew and leave the .Update out altogether?
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1456258
Or could it be that .Update is actually the wrong method and you intended to do something different? (You are talking about BatchUpdate in your question)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:bhummel
ID: 1456259
Actually, what I want to do is all of my updates as well as any adds and then use a .BatchUpdate to Commit the changes through a save button or .CancelBatch to cancel all of the changes through a cancel button.

BatchUpdate does this for changes. My problem is with the Add's. Where does the .AddNew place the record in the rs?

Thanks,
Brad
0
 

Author Comment

by:bhummel
ID: 1456260
Actually, what I want to do is all of my updates as well as any adds and then use a .BatchUpdate to Commit the changes through a save button or .CancelBatch to cancel all of the changes through a cancel button.

BatchUpdate does this for changes. My problem is with the Add's. Where does the .AddNew place the record in the rs?

Thanks,
Brad
0
 

Author Comment

by:bhummel
ID: 1456261
Actually, what I want to do is all of my updates as well as any adds and then use a .BatchUpdate to Commit the changes through a save button or .CancelBatch to cancel all of the changes through a cancel button.

BatchUpdate does this for changes. My problem is with the Add's. Where does the .AddNew place the record in the rs?

Thanks,
Brad
0
 

Author Comment

by:bhummel
ID: 1456262
Actually, what I want to do is all of my updates as well as any adds and then use a .BatchUpdate to Commit the changes through a save button or .CancelBatch to cancel all of the changes through a cancel button.

BatchUpdate does this for changes. My problem is with the Add's. Where does the .AddNew place the record in the rs?

Thanks,
Brad
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1456263
.AddNew doesn't place the record in the rs

To retrieve the newly added record in an rs you'll have to re-create an rs
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

618 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