I am using ClientDataSet.Locate to find a record.

I am using ClientDataSet.Locate to find a record.
One of the two KeyFields is a "Text" field (SqlLite).
However at runtime I get 
"EDatabaseError with message 'Field 'Name' is of an unsupported type'."
       
ItemName := cdsSLItems.FieldByName('Name').AsWideString;
        try
          if cdsSLItems.Locate('IsleId;Name', VarArrayOf([
                         cdsSLItems.FieldByName('IsleId').AsInteger,
                         ItemName]),[loCaseInsensitive]) then

Can someone show me the right way to do this?
#Seattle .

Comments

  1. You can map that Text to WideString for example and it will work.
    ClientDataSet can't load directly from SQLite. Maybe you use FireDAC?
    http://docwiki.embarcadero.com/RADStudio/XE7/en/Data_Type_Mapping_(FireDAC)
    Also UniDAC do have data type mapping.

    ReplyDelete
  2. BTW: Using this kind of field names is dangerous. I would avoid "Name" since you run the risk that it is a "reserved word" ...

    ReplyDelete
  3. #Uwe , Bummer. Finally settled on using a filter.
    #Klaus, Right you are. I must have done that when I wasn't looking.

    Thanks...Dan'l

    ReplyDelete

Post a Comment