Problems in SDAC components version 7

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
m.deltoso
Posts: 9
Joined: Wed 10 Dec 2014 09:19

Problems in SDAC components version 7

Post by m.deltoso » Wed 10 Dec 2014 09:36

Dear Devart,

after upgrading your components to version 7 i get some errors with a particular type of query using UNION ALL operator.

I have reproduced the errors with 2 queries on the AdventuresWork2014 database.

1) "TableName cannot be empty" assertion (Unit MSClasses.pas line 1979-1980 in function TMSSQLRecordSet.FieldListDependsOnParams: boolean;) is fired when trying to open this simple query:

Code: Select all

SELECT
  *
FROM
  HumanResources.Department E

UNION ALL

SELECT
  -1,
  'No dept',
  '',
  NULL

ORDER BY 1
The problem seems to be due to the third field in the second select ('' - empty string). If I replace the empty string with a blank string ' ' the query opens correctly.

2) Application freezes (infinite loop in function TMSSQLRecordSet.FieldListDependsOnParams: boolean; MSClasses.pas) when trying to open this query:

Code: Select all

SELECT
  E.DepartmentID,
  E.Name,
  E.GroupName,
  E.ModifiedDate,
  ISNULL('(' + E.GroupName + ')' + ' ', '') + ISNULL(E.Name, '[NO DEPT]') AS CompleteName
FROM
  HumanResources.Department E
WHERE
  E.DepartmentID <= 10

UNION ALL

SELECT
  E.DepartmentID,
  E.Name,
  E.GroupName,
  E.ModifiedDate,
  ISNULL('(' + E.GroupName + ') ', '') + ISNULL(E.Name, '[NO DEPT]') AS CompleteName
FROM
  HumanResources.Department E
WHERE
  E.DepartmentID > 10

ORDER BY 1
In this case the error seems to be linked to the last field of the second select because if i remove the blank character after the closing bracket (')' instead of ') ') the query opens correctly.

I need a quick update because we use a lot of query of this type in our application and i cannot search for all of them to correct.

Thanks in advance.

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

Re: Problems in SDAC components version 7

Post by azyk » Thu 11 Dec 2014 10:26

We have already fixed these 2 described problems. These fixes will be included into the next SDAC build. The next SDAC build will be released within 1 month.

sofetch
Posts: 7
Joined: Fri 12 Oct 2007 08:33

Re: Problems in SDAC components version 7

Post by sofetch » Fri 13 Feb 2015 14:33

Hi, was it fixed already? I have SDAC version 7.0.2 for delphi XE7. And I got error TableName cannot be empty on TMSQuery. The query is read only, updatingtable is empty.

The query is not intended to be updated anyway. Contains some joins union and everything is wrapped up with upper level query.

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

Re: Problems in SDAC components version 7

Post by azyk » Mon 23 Feb 2015 13:42

We have already fixed this problem. This fix will be included in the next SDAC build.

Post Reply