#1 2013-02-08 10:26:34

arquivo59
Member
Registered: 2013-01-14
Posts: 24

Error on TSQLTableToDataSet

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

#2 2013-02-08 13:41:12

arquivo59
Member
Registered: 2013-01-14
Posts: 24

Re: Error on TSQLTableToDataSet

It is happening with all kind of fields.

Offline

#3 2013-02-08 14:09:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Error on TSQLTableToDataSet

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

#4 2013-02-08 14:24:09

arquivo59
Member
Registered: 2013-01-14
Posts: 24

Re: Error on TSQLTableToDataSet

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

#5 2013-02-08 15:58:25

arquivo59
Member
Registered: 2013-01-14
Posts: 24

Re: Error on TSQLTableToDataSet

Do you think this problem is happening because of the method TSQLTableToDataSet or the declaration of the class?

Offline

#6 2013-02-08 18:08:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Error on TSQLTableToDataSet

Perhaps TSQLTableToDataSet has an issue.

Offline

#7 2013-02-08 18:57:37

arquivo59
Member
Registered: 2013-01-14
Posts: 24

Re: Error on TSQLTableToDataSet

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

#8 2013-02-09 11:03:21

arquivo59
Member
Registered: 2013-01-14
Posts: 24

Re: Error on TSQLTableToDataSet

Having more time to debug, the type of fields that has this issue are: TEnumeration, TTimeLog and sometimes boolean.

Offline

#9 2013-02-09 11:18:59

arquivo59
Member
Registered: 2013-01-14
Posts: 24

Re: Error on TSQLTableToDataSet

I have open a ticket: http://synopse.info/fossil/tktview?name=9de8be5d9e

For us to see this problem more deeply.

Offline

#10 2013-02-18 17:23:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Error on TSQLTableToDataSet

Should be fixed by http://synopse.info/fossil/info/864323a271

I've also added a corresponding sample "17 - TClientDataset use".

Hope it helps.

Offline

Board footer

Powered by FluxBB