0 pts.
 What is the best practice when using vb6/ado/ms sql server stored procedures to retrieve updatable recordsets that can be filtered and sorted?
I am having trouble implementing ado filter and sort on a recordset returned from a stored procedure. The following 2 lines are the same for both adUseClient and adUseServer. prsCommissions.CursorType = adOpenStatic prsCommissions.LockType = adLockOptimistic I found that if I use a client side record set like this: "prsCommissions.CursorLocation = adUseClient" that the recordset does not update, but does sort and filter. If I use a server side recordset like this: "prsCommissions.CursorLocation = adUseServer" that the recordset updates, but does not sort or filter. What is the best practice when using stored procedures to retrieve updatable recordsets that can be filtered and sorted? Thanks in advance!

Software/Hardware used:
ASKED: July 28, 2005  1:45 PM
UPDATED: July 28, 2005  2:43 PM

Answer Wiki:
Congratulations! You are about to advance to the next level of understanding. You have stumbled into an area that you need to explore in depth, especially if you are planning on programming for many years to come. A proper explanation of cursor locations would take many pages to explain the implications. Here is a short answer: adUseServer requires a round trip to the SQL server each time you move to the next row. Look at this in SQL profiler and you will see lots of activity or what some would call *overhead*. You are prevented from re-sorting or filtering since the cursor is managed by the SQL server. In comparison, when reading large datasets you will notice tremendous speed advantages with adUseClient. With adUseClient the server can stream the result set to you in big chunks then move on. Because your recordset and cursor are now on the client you can sort and filter quickly using the clients cpu and ram. The final answer also depends on how many concurrent users will be accesing the sorted/filtered dataset. And how you present your data for updates to the user. I'd recommend that you dive into CursorTypes and see if you cant find an answer there. If you have good primary keys in the recordest you should be able to update rows. Even after they are sorted. Understanding these settings in ADO is very important to your success as a programmer. Dive in and good luck.
Last Wiki Answer Submitted:  July 28, 2005  2:43 pm  by  BeerMaker   0 pts.
All Answer Wiki Contributors:  BeerMaker   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _