Borland®
Shop
Products Downloads Services Support Partners News & Events Company Community
Delphi
Documentation
Support

Additional Resources
Technology Partners
Books
Community

 DELPHI DEVELOPER SUPPORT

Delphi 5 Update Pack fixes

MIDAS SECTION

Areas of concentration under: midas


Area: midas

Reference Number: 73551
Status: Fixed in Delphi 5 Update Pack
Date Reported: 10/22/99
Severity: Serious
Type: Basic Functionality Failure

Problem:

When an error occurs updating a query that 
contains a join, conflict information is not available.  
This is because the code which tries to find the 
conflicting record is not respecting the pfInWhere 
ProviderFlag.

Workaround:

Replace this method in Provider.pas:

procedure TSQLResolver.GenSelectSQL(Tree: 
TUpdateTree; SQL: TStrings;
  Params: TParams; Alias: string);
var
  i: Integer;
  Temp: string;
begin
  with PSQLInfo(Tree.Data)^ do
  begin
    SQL.Add('select');
    for i := 0 to Tree.Delta.FieldCount - 1 do
      with Tree.Delta.Fields[i] do
        if not (DataType in [ftDataSet, ftReference]) 
and (FieldKind = fkData)
           and (pfInWhere in ProviderFlags) then // < 
== Fix is here.
          SQL.Add(Format(' 
%s%s%s%1:s,',[QuotedTableDot, QuoteChar, 
Origin]));
    { Remove last ',' }
    Temp := SQL[SQL.Count-1];
    SQL[SQL.Count-1] := Copy(Temp, 1, 
Length(Temp) - 1);
    SQL.Add(Format(' from %s %s',[QuotedTable, 
Alias]));
    GenWhereSQL(Tree, SQL, Params, 
upWhereKeyOnly, Alias);
  end;
end;


Area: midas\tclientdataset

Reference Number: 67818
Status: Fixed in Delphi 5
Date Reported: 8/5/99
Severity: Serious
Type: Documentation Problem

Problem:

Documented solution to enable demand fetching 
with a stateless server doesn't work.


Updated in del5dbd.hlp delivered to the web
index: incremental fetching, stateless data modules 

Area: midas\tclientdataset

Reference Number: 71456
Status: Fixed in Delphi 5 Update Pack
Date Reported: 9/22/99
Severity: Commonly Encountered
Type: Basic Functionality Failure

Problem:

A TLargeintField cannot be used as  a calculated 
field.


Workaround:

Replace the CalcFieldTypes in DB.PAS as follows:

procedure TDataSet.BindFields(Binding: Boolean);
const
  CalcFieldTypes = [ftString, ftSmallint, ftInteger, 
ftWord, ftBoolean,
    ftFloat, ftCurrency, ftBCD, ftDate, ftTime, 
ftDateTime, ftVariant, ftLargeInt];

Area: midas\tclientdataset

Reference Number: 72241
Status: Fixed in Delphi 5 Update Pack
Date Reported: 10/3/99
Severity: Critical
Type: Crash

Problem:

Internally calculated fields are not sorting properly.

Workaround:

Replace this method in DBClient.pas:

function 
TClientDataSet.CalcFieldsCallBack(RecBuf: 
PChar): DBResult;
var
  SaveState: TDataSetState;
begin
  try
    SaveState := SetTempState(dsInternalCalc);
    try
      CalculateFields(RecBuf);
    finally
      RestoreState(SaveState);
    end;
  except
  end;
  Result := 0;
end;


Area: midas\tclientdataset

Reference Number: 72397
Status: Fixed in Delphi 5
Date Reported: 10/5/99
Severity: Serious
Type: Basic Functionality Failure

Problem:

Cannot provide from a query that uses an 
expression in the order by clause such as "ORDER 
BY UPPER(fldname)"

An error: Field 'UPPER(fldname) not found' is 
generated.

Workaround:

Replace this code in GetIndexForOrderBy in 
DBCOMMON.PAS:

            stFieldName:
            begin
              LastField := Token;
              { Verify that we parsed a valid field name, 
not something like "UPPER(Foo)" }
              Dataset.FieldByName(LastField);
              Result.Fields := AddField(Result.Fields, 
LastField);
            end;

Area: midas\tclientdataset

Reference Number: 73118
Status: Fixed in Delphi 5 Update Pack
Date Reported: 10/15/99
Severity: Commonly Encountered
Type: Basic Functionality Failure

Problem:

If you try to modify a record that was just inserted to 
the dataset you will see an error: Mismatch in 
datapacket.  The DataSetProvider control has the 
poPropagateChanges of the Options property set to 
true.

Area: midas\tclientdataset

Reference Number: 73252
Status: Fixed in Delphi 5 Update Pack
Date Reported: 10/18/99
Severity: Serious
Type: Crash

Problem:

When using a client data set saved file if you restart 
the application after deleting some reconds right 
before closing down the first session you will get an 
error message:  'Operation not applicable' 

//Dataset are cds files//

Area: midas\tclientdataset

Reference Number: 73461
Status: Fixed in Delphi 5 Update Pack
Date Reported: 10/20/99
Severity: Commonly Encountered
Type: Basic Functionality Failure

Problem:

In certain cases nested client datasets can show 
the wrong detail record if the current tmaster has no 
details.

Workaround:

Replace this method in DB.PAS:

function TDataSet.GetNextRecord: Boolean;
var
  GetMode: TGetMode;
begin
  GetMode := gmNext;
  if FRecordCount > 0 then
  begin
    SetCurrentRecord(FRecordCount - 1);
    if (State = dsInsert) and (FCurrentRecord = 
FActiveRecord) and
      (GetBookmarkFlag(ActiveBuffer) = bfCurrent) 
then GetMode := gmCurrent;
  end else if DataSetField < > nil then
    DataSetField.DataSet.UpdateCursorPos;
  Result := (GetRecord(FBuffers[FRecordCount], 
GetMode, True) = grOK);
  if Result then
  begin
    if FRecordCount = 0 then
      ActivateBuffers
    else
      if FRecordCount < FBufferCount then
        Inc(FRecordCount) else
        MoveBuffer(0, FRecordCount);
    FCurrentRecord := FRecordCount - 1;
    Result := True;
  end else
    CursorPosChanged;
end;

Area: midas\tclientdataset

Reference Number: 73601
Status: Fixed in Delphi 5
Date Reported: 10/25/99
Severity: Commonly Encountered
Type: Basic Functionality Failure

Problem:

Calling TClientDataSet.CreateDataSet fails with an 
invalid parameter error if the FieldDefs for the CDS 
includes one or more fields of type ftGuid.



Workaround:

In DSINTF.PAS replace the following:

  FldSubTypeMap: array[TFieldType] of Word = (
    0, 0, 0, 0, 0, 0, 0, fldstMONEY, 0, 0, 0, 0, 0, 0, 
fldstAUTOINC,
    fldstBINARY, fldstMEMO, fldstGRAPHIC, 
fldstFMTMEMO, fldstOLEOBJ,
    fldstDBSOLEOBJ, fldstTYPEDBINARY, 0, 
fldstFIXED, fldstUNICODE,
    0, 0, 0, 0, 0, fldstHBINARY, fldstHMEMO, 0, 0, 0, 
fldstGUID);

Also, after adding the FieldDef, set the size to 38.



Area: midas\tclientdataset

Reference Number: 75518
Status: Fixed in Delphi 5
Date Reported: 11/26/99
Severity: Commonly Encountered
Type: Basic Functionality Failure

Problem:

Aggregate fields do not work at runtime on a 
ClientDataSet that has its Active property set to true 
at design time.
If Active is set to false at design time and the data 
set is opened at runtime the fields do get populated.

Area: midas\tclientdataset

Reference Number: 75682
Status: Fixed in Delphi 5 Update Pack
Date Reported: 11/29/99
Severity: Serious
Type: Crash

Problem:

Trying to provide data from a client dataset which 
contains a wide string field will cause an Access 
Violation.

Workaround:

Requires changes to provider.pas as follows:

procedure 
TDataPacketWriter.PutWideStringField(Info: 
PPutFieldInfo);
var
  W: WideString;
begin
  if Info.DataSet.GetFieldData(Info.field, @W, False) 
then
  begin
    Info.Size := Length(W);
    FIDSWriter.PutField(fldIsChanged, Info.Size * 2, 
PByte(W));
  end else
    FIDSWriter.PutField(fldIsNull, 0, nil);
end;


Area: midas\tclientdataset

Reference Number: 75970
Status: Fixed in Delphi 5 Update Pack
Date Reported: 12/2/99
Severity: Serious
Type: Basic Functionality Failure

Problem:

Cannot create a field of type ftWideString in a client 
dataset by calling CreateDataSet.  A ftString field is 
created instead.

Workaround:

Replace this method in DBCLIENT.PAS:

procedure TClientDataSet.EncodeFieldDesc(var 
FieldDesc: DSFLDDesc;
  const Name: string; DataType: TFieldType; Size, 
Precision: Integer;
  Calculated: Boolean; Attributes: TFieldAttributes);
begin
  with FieldDesc do
  begin
    FillChar(FieldDesc, SizeOf(FieldDesc), #0);
    StrCopy(szName, PChar(Name));
    if DataType = ftWideString then
      iFldType := fldUNICODE else
      iFldType := FieldTypeMap[DataType];
    iFldSubType := FldSubTypeMap[DataType];
    bCalculated := Calculated;
    iFldAttr := Integer(Byte(Attributes));
    case DataType of
      ftADT, ftArray, ftDataSet, ftString, ftFixedChar, 
ftGUID, ftBytes,
      ftVarBytes, ftBlob..ftTypedBinary, ftOraClob, 
ftOraBlob, ftWideString:
        iUnits1 := Size;
      ftBCD:
        begin
          { Default precision is 32, Size = Scale }
          if (Precision > 0) and (Precision < = 32) 
then
            iUnits1 := Precision else
            iUnits1 := 32;
          iUnits2 := Size;  {Scale}
        end;
    end;
  end;
end;

Area: midas\tclientdataset

Reference Number: 76974
Status: Fixed in Delphi 5 Update Pack
Date Reported: 12/16/99
Severity: Serious
Type: Basic Functionality Failure

Problem:

Midas doesn't save an xml file correctly if the 
dataset is empty.  When trying to open the xml file 
you get 'Mismatch in Datapacket' error.

Area: midas\tdatasetprovider

Reference Number: 70329
Status: Fixed in Delphi 5 Update Pack
Date Reported: 9/3/99
Severity: Critical
Type: Crash

Problem:

Control over manual transactions is not possible 
with TDBDatasets. An error message occurs "A 
user transaction is already in progress."



Workaround:

Requires a VCL code change, replace this method 
in dbtables.pas:

function TDBDataSet.PSInTransaction: Boolean;
var
  Database: TDatabase;
begin
  Result := False;
  if Assigned(Sessions.List[SessionName]) then
  begin
    Database := 
Sessions.List[SessionName].DoFindDatabase(Data
baseName, Owner);
    Result := Assigned(Database) and 
Database.InTransaction;
  end;
end;




Area: midas\tdatasetprovider

Reference Number: 72031
Status: Fixed in Delphi 5 Update Pack
Date Reported: 9/29/99
Severity: Serious
Type: Basic Functionality Failure

Problem:

A mismatch in datapacket error can occur if using 
the  ApplyUpdates method of TCustomProvider (the 
overloaded version  that does not have the 
OwnerData parameter.

Workaround:

Call the version of ApplyUpdates that has the 
OwnerData parameter instead.
or
Replace this method in Provider.pas:

function TCustomProvider.ApplyUpdates(Const 
Delta: OleVariant; MaxErrors: Integer;
  out ErrorCount: Integer): OleVariant;
var
  OwnerData: OleVariant;
begin
  Result := ApplyUpdates(Delta, MaxErrors, 
ErrorCount, OwnerData);
end;

NOTE: These listings are for informational use only. It is not intended for use when calling Borland's Developer Support Department.
If you have any suggestions or complaints about these 'Delphi Enhancements and Fixes' pages, please contact the Delphi Administrator. This e-mail address is not intended for support issues.

 
Site Map Search Contact