I am contecting to SQL server 2000. Which is the preferred location for my cursor? client or server? I am trying to get a recordcount and I keep getting a -1. Can anybody offer any suggestions.
riarc
Cursor location to adUseServer (server) is set
when one wants to retrieve data using a forward-only
cursorType which uses least resources as compare to
other CursorTypes. Advantage of using server-side
cursor location is mainly with forward-only cursorType
because this will minimize resource usage on server
as well as, Network Trafic can be minimized too.
Cursor location is set to adUseClient when
recordset is expected to use significant resources
which may prove very costly on server. Also,
CursorType with client-side cursors usually allow
insertion/modification/deletion of records also
sorting and searching are common tasks with
client-side cursors, Which uses more resources but
network usage can significantly decrease because there
will be no communication with server for searching as
well as adding records in recdordset. Only when u issue
update statement, your communicatin wiil start with
server.
Simply :
Server-side cursors are used to minimize/avoid
network trafic. Forward-only cursorType is recommended
for server-side cursors.
client-side cursors are used to minimize resources
on server. Beware too much communication with server may
turn this crusor location your biggest nightmare (because
of network trafic).
As far as RecordCount property is concerned no approximate
positioning is supproted by forward-only cursor. use
static or keyset which will surely support approximate
positioning which is vital for RecordCount property. For
dynamic cursoryType Data Source will decide wether
approximate positioning is supported if, it is then u
can use RecordCount property otherwise not.
remember -1 indicates "No Information Available"
in addition to what has been presented above I would like to add a few things:
1. Client-Side servers can be disconnected from the connection. This reduces the strain on the serve and frees up connections in the connection pool, while still allowing the application to manipulate the data.
2. When retrieiving a large recordset but actually only working with a small subset, Microsoft advises using a server side cursor.
James James Culshaw
jculshaw@active-data-solutions.co.uk
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.