You are not logged in.
Pages: 1
Hello,
When I try to use the method TSQLTableToDataSet I get the error: "Could not convert variant of type (UnicodeString) into type (Date)".
I'm using the ORM with SQlite.
I have a property BirthDate of type TTimeLog, I suspect that the error is with this TTimeLog type of Field. Because I have fields TModTime and TCreateTime but the error started after I add the BirthDate : TTimeLog.
Is this a error of the framework? How can I handle It properly?
Last edited by arquivo59 (2013-02-08 10:37:04)
Offline
It is happening with all kind of fields.
Offline
Are you sure you use the latest unstable 1.18 version from http://synopse.info/fossil/wiki?name=Get+the+source ?
Which version of Delphi are you using?
Offline
I'm using Delphi XE2 UP4.
The latest unstable 1.18 version that I'm using is this one: http://synopse.info/fossil/info/9e89095221
The class is:
TTipoPessoa = (tpJuridica, tpFisica);
TCliente = class(TSQLVO)
private
FDivida: Currency;
FDataAlteracao: TModTime;
FIdade: Integer;
FNome: RawUTF8;
FDataNascimento: TDateTime;
FCNPJ: RawUTF8;
FEndereco: TEndereco;
FEnderecoLogradouro: RawUTF8;
Fchk1: Boolean;
FTipoPessoa: TTipoPessoa;
FData: TDateTime;
published
property Nome: RawUTF8 read FNome write FNome;
property Idade: Integer read FIdade write FIdade;
property DataAlteracao: TModTime read FDataAlteracao write FDataAlteracao;
property Divida: Currency read FDivida write FDivida;
property DataNascimento: TDateTime read FDataNascimento
write FDataNascimento;
property CNPJ: RawUTF8 read FCNPJ write FCNPJ;
property Endereco: TEndereco read FEndereco write FEndereco;
property EnderecoLogradouro: RawUTF8 read FEnderecoLogradouro
write FEnderecoLogradouro;
property chk1 : Boolean read Fchk1 write Fchk1;
property TipoPessoa : TTipoPessoa read FTipoPessoa write FTipoPessoa;
end;
Offline
Do you think this problem is happening because of the method TSQLTableToDataSet or the declaration of the class?
Offline
Ok, what can we do to solve this problem?
I was debuging and seens like the problem is in this line:
else result.Fields[F].AsVariant := aTable.GetVariant(i,F,aClient);
when the framework is populating the clientdataset.
What do you guys think?
Offline
Having more time to debug, the type of fields that has this issue are: TEnumeration, TTimeLog and sometimes boolean.
Offline
I have open a ticket: http://synopse.info/fossil/tktview?name=9de8be5d9e
For us to see this problem more deeply.
Offline
Should be fixed by http://synopse.info/fossil/info/864323a271
I've also added a corresponding sample "17 - TClientDataset use".
Hope it helps.
Offline
Pages: 1