Hi everybody,
When should we use Server side cursors on ADO recordsets and when should we use Client side cursors ? Please explain with reasons.
Printable View
Hi everybody,
When should we use Server side cursors on ADO recordsets and when should we use Client side cursors ? Please explain with reasons.
Nobody knows about this ???
I think it is very important to know this.
if you know what happens to both of them then you will know when to use them.
Client side cursors reflect the state of the database data at the time that your recordset is opened, resync, requery. Any changes made to the recordset is done on the client side and unless the recordset is updated there is no sync with the database.
Server side cursors reflect the state of the database data now, as it changes so does the data in your recordset. Which means that as data is being changed and added by other users, you are able to see this now without and resync, requery. the same is for the other users, they see what you have done.
client side works well for static recordsets ( as table of the states or the member of the UN) this table has very low if any updates and or additions. thus your refrence tables for your application can use these.
You data tables on the other hand on a multiuser environment should use server side. lets say you work in a inventory department for a major company. your friend works in the same department in a different building. you are updating the stock levels for items that you just received and your boss calles him to get a stock count so he opens his form and the list of 1 million items populate his recordset. now you keepmaing changes and then you done. but his recordset already opened and data retreived from the database. he sees that you have 23 of item X, the boss asks that it be faxed over to him. so he prints and faxes all of a sudden he is seeing that some of the data looks different from what he was when he was on the form. now you see that having the database control the cursor worked to his advantage cause item X costs $10,000.00 and the company does no want to over order. the data has been updated without any updates or requery or any of that.
one other advantage is that in the even that you use client side and he goes and change the value of a field that you just worked on when he clicks save he updates the field that he wants to and he also returns all the other fields to what he is seeing thus all your work on that record is down the drain and the data on the item is wrong.
hope that helped you some
slient side is really for single user apps and tables that have very low update and add frequencies.
server side is for multi user environments and on data intensive tables where at anyone time many persons are updating and or adding data to the table(s)
Thanks for the reply !