client side cursor vs. server side cursor 
Author Message
 client side cursor vs. server side cursor
What are the advantages/disadvantages of using each type of ADO connection/recordset
to access data in SQL 2000?

It seems that many times there are methods I'd like to use but they aren't available
using a server side cursor, but if I use a client side cursor will I have potential
problems with my code not working on some machines?  Any insight is appreciated.

TIA

Carter



Mon, 10 Oct 2005 22:58:47 GMT
 client side cursor vs. server side cursor

Quote:

> What are the advantages/disadvantages of using each type of ADO
> connection/recordset to access data in SQL 2000?

Here are the cursor types in order of functionality (least to most -
descriptions can be found on this page:
http://msdn.microsoft.com/library/en-us/ado270/htm/mdaenumac_15.asp):

0 - Forward Only
1 - Static
2 - keyset
3 - dynamic

Coincidently, this is also the order of performance (most to least) and
resources (least to most). The more functionality gained, the more resources
used, and the less performance realized. Always use the least-functional
cursor required to perform your task. If you don't need to scroll back and
forth through the records, then use a forward-only cursor. If you need a
scrollable cursor (to enable recordcount, etc.), but you don't need to see
changes made by other users, use a static cursor. And so on ...

Quote:

> It seems that many times there are methods I'd like to use but they
> aren't available using a server side cursor, but if I use a client
> side cursor will I have potential problems with my code not working
> on some machines?

No. If ADO is working, the client-side cursor library will be working. Just
be sure there aren't other, more efficient ways to achieve the what you need
before going to a more expensive cursor. For example, many people will open
a client-side cursor, just to be able to use recordcount. This is just
silly. If you use GetRows to read the data from a forward-only cursor into
an array (arResults), the record count is simply gained by adding 1 to the
number returned by Ubound(arResults,2). This is not to mention the
performance and scalability gains achieved by being able to immediately
close the recordset and connection and work with the data in the more
efficient array.

HTH,
Bob Barrows



Tue, 11 Oct 2005 00:00:53 GMT
 client side cursor vs. server side cursor
Thanks for the input!

Carter


Quote:

> > What are the advantages/disadvantages of using each type of ADO
> > connection/recordset to access data in SQL 2000?

> Here are the cursor types in order of functionality (least to most -
> descriptions can be found on this page:
> http://msdn.microsoft.com/library/en-us/ado270/htm/mdaenumac_15.asp):

> 0 - Forward Only
> 1 - Static
> 2 - keyset
> 3 - dynamic

> Coincidently, this is also the order of performance (most to least) and
> resources (least to most). The more functionality gained, the more resources
> used, and the less performance realized. Always use the least-functional
> cursor required to perform your task. If you don't need to scroll back and
> forth through the records, then use a forward-only cursor. If you need a
> scrollable cursor (to enable recordcount, etc.), but you don't need to see
> changes made by other users, use a static cursor. And so on ...

> > It seems that many times there are methods I'd like to use but they
> > aren't available using a server side cursor, but if I use a client
> > side cursor will I have potential problems with my code not working
> > on some machines?

> No. If ADO is working, the client-side cursor library will be working. Just
> be sure there aren't other, more efficient ways to achieve the what you need
> before going to a more expensive cursor. For example, many people will open
> a client-side cursor, just to be able to use recordcount. This is just
> silly. If you use GetRows to read the data from a forward-only cursor into
> an array (arResults), the record count is simply gained by adding 1 to the
> number returned by Ubound(arResults,2). This is not to mention the
> performance and scalability gains achieved by being able to immediately
> close the recordset and connection and work with the data in the more
> efficient array.

> HTH,
> Bob Barrows



Tue, 11 Oct 2005 03:28:52 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Client Side Cursors vs Server Side Cursors

2. Please explain server side cursor vs client side cursor and CacheSize=1

3. what is a server-side cursor vs client-side

4. ?client-side vs server-side cursors

5. ADO-Access2000: Server-side vs Client-side cursor

6. ?client-side vs. server-side cursors

7. Client-Side Cursors vs. Server-Side Cursors vs. Web

8. ADO Cursor: Client Side or Server Side

9. Server side or client side cursors?

10. Client Side and Server Side Cursors

11. Client-side versus Server-side cursors

12. ADO Cursor: Client Side or Server Side


 
Powered by phpBB® Forum Software