Can you set a recordset value temporarily?

I'm using vb6 and connecting thru ADO.
I want to know if its possible to select
an item from the db, then go thru each item
in the recordset and if any equal 0 then change it to 1

Basically I have a quantity field and if
that value is zero I want to change it to
1 only temporarily.

I'll be using the code in a Crystal Viewer form
and I do not want to update the db.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Here you go!



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
use another field for temporary insertion.
take care to clear its values when you don't need it anymore - until the next time.
Of course the answer posted will update your db permanently.

In DAO I would create a workspace and use a begintrans method at the start of my procedure, and a rollback method at the end. This will cancel any change made to the database during your procedure. I'm not sure if the workspace object is part of ADO, however. If you can't rollback in ADO, I like AnswerTheMan's suggestion.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Sorry, when I pasted the answer I gave, I forgot the CRITICAL line...

Set duplicate = original.Clone

Disregard the clone, It doesn't keep a separate copy of the recordset in vb5, You need to set a local variable copy, then edit/update and then restore the local copy.

StoopAuthor Commented:
A little more info on my question.....I'm also using seagate's crystal reports and the table that it queries holds the quantity value and the only time I want the zeros to change to ones is when you print or preview the report
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.