Error with CTE (Common Table Expressions)

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 3
Joined: Sun 31 Jul 2011 10:46

Error with CTE (Common Table Expressions)

Post by sailorman » Sun 31 Jul 2011 15:12

When I execute the following query I get the assertion error below.

WITH Address(City,Province,Country) AS (
SELECT City,StateProvince,CountryRegion
SalesLT.Address )
select * from Address

Assertion failure (D:\Projects\Delphi\Dac\SqlServer\Source\OLEDBAccess.pas, line 9743)

Microsoft SQL Server: 10.00.4064
Microsoft OLE DB Provider for SQL Server: 06.01.7601

SDAC Trial Edition
Version for Delphi


Post by AndreyZ » Mon 01 Aug 2011 13:47


Thank you for the information. We have reproduced the problem and the investigation of the problem is in progress. As soon as we solve the problem we will let you khow.

Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 23 Aug 2011 13:56

We have fixed this problem. This fix will be included in the next SDAC build. But OLEDB incorrectly supports queries with the "WITH ... AS" clause when using server cursor. Therefore to solve this problem, you should set the TMSQuery.CursorType property to ctDefaultResultSet.

Post Reply