Better way for reading field values

From: Thomas Seban (tse_at_relate.de)
Date: 07/08/04


Date: Thu, 8 Jul 2004 09:15:44 +0200

Hello,

i have a question about fast way for catching field values from a recordset.
At this time, i read each value in a loop and assign it to an other value
like this:

[part]
    DS.Append;
    for iLoop := 0 to (Recordset.Fields.Count - 1) do begin
(X) Value := Recordset.Fields[iLoop].Value;
      if not VarIsNull(Value) and not VarIsEmpty(Value) then begin
        DS.Fields[iLoop].Value := Value;
      end;
    end;
    DS.Post;

[/part]

The line with (X) slows down my application with a factor of five. So, is
there a faster way to catch all values of a recordset? Or, if available, is
there a way to store/read an ado recordset directly to/from disc without
caching all records in memory?

Best Regards
Thomas Seban



Relevant Pages

  • Re: DAO MUCH faster than ADO in this test
    ... DAO is well-known to be faster than ADO. ... Of course the DAO loop ran faster than the SQL loop; ... advantage of a table-type recordset, which only works on local tables. ... Dim starttime As Single, finishtime As Single ...
    (microsoft.public.access.modulesdaovba)
  • Re: Do While Loop nested in another While causes error
    ... still doesn't explain why a nested DO loop would cause problems. ... Until you sort out the contents of the recordset, ... idHolder = rsGuestbook ... display that new ID. ...
    (microsoft.public.inetserver.asp.db)
  • Re: One more ! Calculating Recordset Values
    ... Well I am almost there lol, got the recordset to work properly returning all ... the values in the one "loop" so to speak and I can see them being returned ... >> Dim aTot, eTot, iTot, pSubTot, aStrengthSubTot, PTotal, SubTotal, ... >>> totals ...
    (microsoft.public.frontpage.programming)
  • Re: Iterating Functions
    ... previous iterations will be lost. ... Re-Read the table "ORDER BY" the sequence number ... indicates a loop!! ... nested Recordset objects but one Connection object with success. ...
    (microsoft.public.scripting.vbscript)
  • Re: One more ! Calculating Recordset Values
    ... EOF means that the end of the RecordSet has been reached. ... > 'Total = The sum of all the SubTotals ...
    (microsoft.public.frontpage.programming)