Re: Didn't ADO used to default to client-side cursors?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: David Gugick (davidg-nospam_at_imceda.com)
Date: 12/02/04


Date: Thu, 2 Dec 2004 15:26:17 -0500

jxstern wrote:
> I just chased down an apparent SQLServer performance problem to the
> fact that the VB6 app was keeping the recordset alive for thirty
> seconds. Profiler was reporting thirty seconds as the duration, when
> in fact the select runs in about 0.2 seconds and the 16k records
> transfer in about 0.8 seconds (then the VB app loads them into a big,
> fat grid - probably not a good idea anyway, but that's another topic).
>
> Setting cn.CursorLocation = adUserClient fixes it all up, as far as
> profiler and SQLServer 2000 care.
>
> My question is, didn't VB6 and ADO, back a few years ago, default to
> client-side cursors? I remember being shocked because the previous
> RDO had defaulted (with SQLServer 6.5) to server-side.
>
> Just a history question, but inquiring minds, and all that.
>
> Thanks.
>
> Josh

It's not that ADO is keep it alive, but your application is taking that
long to fetch all the data. This is probably a foward-only, read-only
result set, the best kind. For most result sets having the server create
the result set (which it has to do anyway) is the fastest because
there's no reason to create an additional ADO result set on the client
if your intention is to quickly scroll through the results and destroy
the result set object.

In your case, the application fetches through the result set and loads
all 16k records into a grid which is slowing things down and potentially
keeping locks on the server while those unfetched rows remain on the
server. You could eliminate this by using a NOLOCK hint. In your case,
you may see better results because the local ADO resultset can probably
load faster than the grid can load. Have you noticed whether the
application performs a little slower using the client-side cursor?

-- 
David Gugick
Imceda Software
www.imceda.com 


Relevant Pages

  • Re: Didnt ADO used to default to client-side cursors?
    ... > I just chased down an apparent SQLServer performance problem to the ... > fact that the VB6 app was keeping the recordset alive for thirty ... > My question is, didn't VB6 and ADO, back a few years ago, default to ... load faster than the grid can load. ...
    (microsoft.public.sqlserver.server)
  • Re: Fill Dataset from csv file
    ... I know of no way with the built in capabilities of ADO .NET (will have to ... load it into a DataTable and load each row yourself. ... > I need to fill a dataset from a csv file. ... the file is uploaded in the server's memory. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Jet >SQL conversion
    ... > difficult to do with ADO, accessing data from sources other than Jet ... connect object, but ado is more suited to this. ... working with sql server, but really, linked dao tables work just fine. ... the form will start to load slow. ...
    (microsoft.public.access.modulesdaovba)
  • issues with MS Acces, ADO, MDAC and XP sp2
    ... I have a VB6 app which connects to an MS Access 2000 app locally using ADO ... After installing sp2 on our XP Pro test machine I get an "Unknown error" ... when trying to open a recordset with optimistic record locking. ...
    (microsoft.public.data.ado)
  • How to load Tables Column Names into a Grid
    ... I'm using D7, ADO, MSSQL2000 ... I want to create a generic report where the user select all the Columns from ... the table and load them into a Grid How do I do that. ... Prev by Date: ...
    (borland.public.delphi.database.ado)