procedure TCustomMSTable.PrepareSQL and FastReport5

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
LHSoft
Posts: 104
Joined: Sat 18 Aug 2012 08:33

procedure TCustomMSTable.PrepareSQL and FastReport5

Post by LHSoft » Sat 12 Sep 2015 09:59

Hello,
there is an error in proc above in this line (4682):

Code: Select all

if (DataSource <> nil) and (FMasterFields <> '') and (FDetailFields <> '') and not DataSource.DataSet.Active
DataSource.DataSet is nil when opening a table in FR5 with master-detail set.

so now question is: should DataSource.DataSet not be nil or can I modify the condition til your next version so DataSource.DataSet.active will not be queried if DataSource.DataSet is nil?

best regards
Hans

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: procedure TCustomMSTable.PrepareSQL and FastReport5

Post by azyk » Wed 16 Sep 2015 14:02

We can't reproduce the described behavior. Please try to compose a small sample to demonstrate the problem and send it to andreyz*devart*com .

LHSoft
Posts: 104
Joined: Sat 18 Aug 2012 08:33

Re: procedure TCustomMSTable.PrepareSQL and FastReport5

Post by LHSoft » Thu 17 Sep 2015 03:21

Hello,

Email is sent,
FastReport support got the error too.

best regards
Hans

LHSoft
Posts: 104
Joined: Sat 18 Aug 2012 08:33

Re: procedure TCustomMSTable.PrepareSQL and FastReport5

Post by LHSoft » Thu 17 Sep 2015 07:14

By the way:
I have interim avoided this error:

Code: Select all

  if (DataSource <> nil) and (FMasterFields <> '') and (FDetailFields <> '')
  then begin
    if DataSource.DataSet <> nil then
      if DataSource.DataSet.Active then exit;

    MasterPos := 1;
    while True do begin
      MasterName := ExtractFieldName(FMasterFields, MasterPos);
      if MasterName <> '' then begin
        Param := Params.FindParam(MasterName);
        if Param <> nil then
          Param.DataType := ftString;
      end
      else
        break;
    end;
  end;

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: procedure TCustomMSTable.PrepareSQL and FastReport5

Post by azyk » Fri 18 Sep 2015 11:03

Thank you for the provided sample. We have reproduced the described problem and fixed it.

LHSoft
Posts: 104
Joined: Sat 18 Aug 2012 08:33

Re: procedure TCustomMSTable.PrepareSQL and FastReport5

Post by LHSoft » Sat 19 Sep 2015 07:54

Hello,

thanks.
In new version 7.2.8 error still exists.

By the way:
in fs_isdacrtti.pas of your FR5 source code OLEDBAccess (->EMSError) is missing in the uses section.

best regards
Hans

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: procedure TCustomMSTable.PrepareSQL and FastReport5

Post by azyk » Mon 21 Sep 2015 08:57

This fix wasn't included in SDAC 7.2.8, it will be included in the next build of SDAC.

Thank you for your note. We have added the OLEDBAccess unit in the uses section of fs_isdacrtti.pas. This modification will be included in the next SDAC build too.

LHSoft
Posts: 104
Joined: Sat 18 Aug 2012 08:33

Re: procedure TCustomMSTable.PrepareSQL and FastReport5

Post by LHSoft » Mon 21 Sep 2015 09:17

perfettamente :)

thanks
Hans

Post Reply