Link to home
Start Free TrialLog in
Avatar of bhummel
bhummel

asked on

Oracle, RDO Updateable RS and .AddNew

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
ASKER CERTIFIED SOLUTION
Avatar of caraf_g
caraf_g

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of caraf_g
caraf_g

Having said that... why don't you just move the code after the .AddNew to before the .AddNew and leave the .Update out altogether?
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)
Avatar of bhummel

ASKER

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
Avatar of bhummel

ASKER

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
Avatar of bhummel

ASKER

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
Avatar of bhummel

ASKER

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
.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