Recordset speed problem

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

From: Vlad (vovan.c_at_verizon.net)
Date: 04/08/04


Date: Thu, 8 Apr 2004 12:32:17 -0400

I'm moving VB 6 app from Access (DAO) to SQL Server (ADO).
With DAO all recordsets are created with
Set RS = dbObject.OpenRecordset("MySQL", ....)
approach.

When I replaced an Access db with another one containing only links to SQL
Server db, everything continued to work with almost the same speed.
Then I started to convert DAO recordsets to ADO recordsets working directly
with SQL Server. If I use
Set RS =New ADODB.Recordset
RS.Open "MySQL", objConnection, , adOpenStatic, adLockOptimistic
approach, creation of recordset takes significant time. Maybe not too much
for a single recordset, but in some cases I need to open about 20 recordsets
at a time and it takes 5-10 seconds. It's not acceptable.
If I create all recordsets through executing Command objects with stored
procedures, then everything is very fast. This approach requires to write a
lot of additional codes (Stored Procedures themselves, Parameter objects,
Command objects).
Is there any way to speed up creation of recordsets without using the second
approach? I tried to use different cursors with no success. Any advice
please.
I also was wondering if it's possible to create an updatable recordset with
Stored Procedure. Or all of them are read only?
Thank you
Vlad



Relevant Pages

  • Re: ActiveX component cant create object.
    ... DAO in the same project... ... the new way to access data is with ADO." ... recordsets; persisting recordsets on disk which ... to take advantage of their relative merits. ...
    (microsoft.public.access.security)
  • Re: button that prompts for a value and then enters it into a field
    ... Dim rs As Object ... Access uses either DAO or ADO to communicate with the underlying Jet ... The FindFirst method is only available in DAO recordsets, ...
    (microsoft.public.access.forms)
  • Re: Zugriff auf Datenbank übers Netzwerk dauert ewig!!!
    ... > GHz) dauert es ca. 13 Sekunden bis alle Datensätze geladen sind. ... Schon vor dem Einlesen des Recordsets oder erst nachdem die Daten ... Nur um auf einen Datenbank zuzugreifen braucht man weder bei ADO noch bei ... DAO ein DataControl. ...
    (microsoft.public.de.vb.datenbank)
  • Re: VB application crashes
    ... MSCOMCTL! ... The recordsets should be closed and set to Nohting after use.... ... There are issues when reusing a Recordset object when using ADO. ... For either DAO or ADO creating one connection or DAOEngine object per app is ...
    (microsoft.public.vb.general.discussion)
  • Re: button that prompts for a value and then enters it into a field
    ... Dim strSearchName As String ... Access uses either DAO or ADO to communicate with the underlying Jet ... The FindFirst method is only available in DAO recordsets, ...
    (microsoft.public.access.forms)