Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 12466, Fix for bug where PacketRecords*RecordSize>24KB

by Dan Miser Email: Anonymous


Download Details
FTP  download also available 0 bytes
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Delphi, Version 2.0  to 2.0 20 downloads
Copyright: No significant restrictions


Size: 0 bytes
Updated on Fri, 14 May 1999 00:00:00 GMT
Originally uploaded on Fri, 14 May 1999 00:00:00 GMT
Description
PROVIDER.PAS (4.02 only)
// Fixes bug where PacketRecords*RecordSize>24KB
(**) (* Josh Dahlby (99-01-19): Replace entire method *)
function TDataPacketWriter.WriteDataSet(DataSet: TDataSet; var Info:TInfoArray; RecsOut: Integer; FastScan: Boolean): Integer;
const
B: Byte = 0;
var
i, BlockSize: Integer;
FirstRead, FetchAll: Boolean;
begin
Result := 0;
FirstRead := True;
BlockSize := 24*1024 div DataSet.RecordSize;
FetchAll := RecsOut = -1;
if FetchAll then RecsOut := High(Integer);
try
if DataSet.DefaultFields then RefreshPutProcs(DataSet, Info);
while (not DataSet.EOF) and (Result < RecsOut) do
begin
FDSWriter.PutField(fldIsChanged, 1, @B);
for i := 0 to High(Info) do Info[i].PutProc(@Info[i]); Inc(Result);
if (Result >= RecsOut) then
begin
if DataSet.BlockReadSize > 0 then
DataSet.BlockReadSize := -1 else
DataSet.Next;
end
else if FirstRead and FastScan and (RecsOut > 2) then
begin
FirstRead := False; if BlockSize > (RecsOut - 1) then BlockSize := RecsOut - 1; DataSet.BlockReadSize := -1 * (BlockSize);
end
else
begin
if not FetchAll and ((Result - 1) mod BlockSize = 0) and((RecsOut - Result) < BlockSize) then
DataSet.BlockReadSize := -1 * (RecsOut - Result) else
DataSet.Next;
end;
end;
finally
DataSet.BlockReadSize := 0;
end;
end;

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC03