IndexFieldNames issue

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

IndexFieldNames issue

Post by MarkF » Thu 04 Apr 2013 10:44

I'm using version 8.6.12. It appears that something has changed with IndexFieldNames such that double quotes are no longer allowed in the column name. This causes a problem if the column name includes a space. Our original code looks like:

Code: Select all

      FldName := FDataSet.FieldDefs[ADataCol].DisplayName;
      FldName := AnsiQuotedStr(FldName, '"');   // No longer allowed?
      case ASortDir of
        sdAsc:  SortString := FldName + ' ASC  CIS';
        sdDesc: SortString := FldName + ' DESC CIS';
      end;
      FDataSet.IndexFieldNames := SortString;
-Mark Ford
Benthic Software

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Re: IndexFieldNames issue

Post by MarkF » Thu 04 Apr 2013 11:10

In looking at the source code, it appears that instead of using doublequotes, we can use square brackets. This seems to work even if a field's displayname contains a space, however it fails if the field's displayname contains a square bracket. It seems like allowing double quotes as the field name delimiter in IndexFieldNames is a better choice. It would be interesting to know why this was changed.

-Mark Ford
Benthic Software

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: IndexFieldNames issue

Post by AlexP » Thu 04 Apr 2013 14:40

Hello,

Thank you for the information, we have already fixed the problem with quoting, this fix will be added to next version, that will be released this month.

Post Reply