Problems with the table having a field named 'Index' in TMSQuery

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Alexander_73
Posts: 52
Joined: Mon 24 Mar 2008 13:22

Problems with the table having a field named 'Index' in TMSQuery

Post by Alexander_73 » Mon 24 Mar 2008 13:44

In table having field named 'Index'.
Both of a way: setting of property MSQuery.UpdatingTableName and by SQL Generator at method TMSQuery.Post cause an error: @Incorrect syntax near 'Index'... The error disappears only at editing sql-queries for insert and update by changing name 'Index' on '[Index]'.
In our bases there are hundreds tables containing fields conterminous with reserved words of MS SQL Server, we cannot change all of tables because paying SDAC.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 24 Mar 2008 14:00

Set the QuoteNames option of TMSQuery to True.

Alexander_73
Posts: 52
Joined: Mon 24 Mar 2008 13:22

Post by Alexander_73 » Mon 24 Mar 2008 14:23

Thanks!

Post Reply