I have an original table from wich I need to manipulate data and insert this changed data into a new table...all without altering the data values in my original table. I thought the best way to do this would be to use disconnected recordsets.
So, First I open my recordset, RS, which contains all the original values from my origin table. Lets say there are 1000 original rowsets.
Next I set my active connection to Nothing to make my recordset disconnected : RS.ActiveConnection = Nothing
Next I process my disconnected recordset through an IF statement that deletes any rowsets that contain a value = 0. If I put a counter within this IF statement, it says that there are 100 rowsets that contain zeros and were supposedly deleted.
However, if I count the number of rowsets after the supposed deletion I still have 1000 rowsets, and if I insert this "altered" Recordset into my new table the zeros in my data were never deleted.
Does anyone now how to manipulate and edit the disconnected recordset so that it will reflect the changes when I insert it into my new table? Is there an update command or something like this that needs to be performed before my recordset will reflect the changes?
Thanks for any input you might have!! And if you need actual code to help me trouble shoot, just let me know....thanks again.
Originally posted by TRoche
I haven't tried this...
I will as soon as I can, but do you have a sample script showing this UpdateBatch syntax?
Thanks for you help and I will give it a shot!
It's really quite simple.
You first reconnect your disconnected recordset after performing the updates, the just call UpdateBatch. This method takes one optional parameter with which you can declare which records to update, default is all records.
set rs.ActiveConnection = YourConnection