TSQLDataset error when migrating from delphi 7 to delphi XE4

I have a TSQLDataSet in a Delphi 7 application. It extracts 2 fields (ID and Name) from the MyTable table.

 object SQLDataSet: TSQLDataSet GetMetadata = False CommandText = 'select * from MyTable' MaxBlobSize = -1 Params = <> SQLConnection = mySQLConnection object SQLDataSetID: TIntegerField FieldName = 'ID' ProviderFlags = [pfInUpdate, pfInWhere, pfInKey] Required = True end object SQLDataSetNAME: TStringField FieldName = 'NAME' Required = True Size = 50 end end 

When I switched to Delphi XE4, I get the following error:

 class EDatabaseError with message 'SQLDataSet: Type mismatch for field 'NAME', expecting: String actual:WideString' 

What is the possible cause of this problem and how do I get rid of it?

Note. I am using firebird 2.5.2 .

+4
source share
1 answer

Change TStringField to TWideTStringfield

 object SQLDataSet: TSQLDataSet GetMetadata = False CommandText = 'select * from MyTable' MaxBlobSize = -1 Params = <> SQLConnection = mySQLConnection object SQLDataSetID: TIntegerField FieldName = 'ID' ProviderFlags = [pfInUpdate, pfInWhere, pfInKey] Required = True end object SQLDataSetNAME: **TWideStringField** FieldName = 'NAME' Required = True Size = 50 end end 
0
source

All Articles