You are not logged in.
Pages: 1
Hi all,
I use this code in Delphi Berlin, FMX Aplication, target Android. My device is a Zenfone 3 with Android Oreo 8.0...
procedure TFrm_Prot_Neo_01_Cli_Fire.TabLancamentosClick(Sender: TObject);
var
ListItem: TListViewItem;
begin
{$IFDEF MSWINDOWS}
Lista_Cad_Neo := TSQLCad_Neo_01.CreateAndFillPrepare(Dm.BaseDados, ' ID > -1 ORDER BY ID ');
Lista_Cad_Tipo_Cad := TSQLTipo_Cad.CreateAndFillPrepare(Dm.BaseDados, ' ID > -1 ORDER BY ID ');
{$ENDIF}
{$IFNDEF MSWINDOWS}
Lista_Cad_Neo := TSQLCad_Neo_01.CreateAndFillPrepare(Dm.BaseDados, '', ' ID > -1 ORDER BY ID ', []);
Lista_Cad_Tipo_Cad := TSQLTipo_Cad.CreateAndFillPrepare(Dm.BaseDados, '', ' ID > -1 ORDER BY ID ', []);
{$ENDIF}
ListLancamentos.Items.Clear;
ListLancamentos.BeginUpdate;
while Lista_Cad_Neo.FillOne do
begin
ListItem := ListLancamentos.Items.Add;
ListItem.Text := IntToStr(Lista_Cad_Neo.ID) + ' - ' + UTF8ToString(Lista_Cad_Neo.Descricao) + ' - ' + DateToStr(Lista_Cad_Neo.Data_Cad);
end;
end;
In FillOne line, i received in the device an error:
JSONVariantData.Data(20<>JSONVariant)
I'm attaching an image with the error screen..
Removing fillone no error occurs
In Windows 32 bit, this code works!
What could be happening? Can someone help me?
Offline
My TSQLRecords
unit U_Cad_Neo_01;
interface
uses
U_Tipo_Cad,
{$IFDEF MSWINDOWS}
mORMot, SynCommons;
{$ENDIF}
{$IFNDEF MSWINDOWS}
SynCrossPlatformREST;
{$ENDIF}
type
TSQLCad_Neo_01 = class(TSQLRecord)
private
FDescricao: RawUTF8;
// FTipo_Cad: Integer;
FTipo_Cad: TSQLTipo_Cad;
FData_Cad: TDateTime;
FValor_Cad: Currency;
{$IFDEF MSWINDOWS}
fVersion: TRecordVersion;
{$ENDIF}
published
property Descricao: RawUTF8 index 200 read FDescricao write FDescricao;
// property Tipo_Cad: Integer read FTipo_Cad write FTipo_Cad;
property Tipo_Cad: TSQLTipo_Cad read FTipo_Cad write FTipo_Cad;
property Data_Cad: TDateTime read FData_Cad write FData_Cad;
property Valor_Cad: Currency read FValor_Cad write FValor_Cad;
{$IFDEF MSWINDOWS}
property Version: TRecordVersion read fVersion write fVersion;
{$ENDIF}
end;
implementation
end.
and
unit U_Tipo_Cad;
interface
uses
{$IFDEF MSWINDOWS}
mORMot, SynCommons;
{$ENDIF}
{$IFNDEF MSWINDOWS}
SynCrossPlatformREST;
{$ENDIF}
type
TSQLTipo_Cad = class(TSQLRecord)
private
FDescricao: RawUTF8;
{$IFDEF MSWINDOWS}
fVersion: TRecordVersion;
{$ENDIF}
published
property Descricao: RawUTF8 index 50 read FDescricao write FDescricao;
{$IFDEF MSWINDOWS}
property Version: TRecordVersion read fVersion write fVersion;
{$ENDIF}
end;
implementation
end.
Can it be the TRecordVersion field?
Thanks Ab
Offline
Most probably... you are sharing not the same class between both ends.... so it is most likely to fail!
Don't leak your TSQLRecord - use dedicated SOA interface services, with proper DTO records/arrays with your clients.
Please check this discussion https://synopse.info/forum/viewtopic.ph … 991#p26991
Offline
Pages: 1