Search found 301 matches

by Ludek
Thu 18 Jan 2007 10:43
Forum: SQL Server Data Access Components
Topic: Forcibly fetch remainig rows for each dataset?
Replies: 12
Views: 4782

Forcibly fetch remainig rows for each dataset?

Hi, I'm having trouble with TMSConnection and FetchAll=false. I already know, that there's problem with starting transaction with unfetched rows, so I simply want do fetch all already unfetched datasets. Ho can I do it? Can't find any such method, thus I'm using following now:

Code: Select all

  for i := 0 to connection.DataSetCount - 1 do begin
    if connection.DataSets[i] is TCustomMSDataset then begin
      ds := connection.DataSets[i] as TCustomMSDataset;
      if not ds.FetchAll then begin
        ds.FetchAll := true;
        ds.FetchAll := false;
      end;
    end;
  end;
I simple HAVE TO start the transaction, what is the best solution? My solution works, but I don't like it at all :x