#1 2014-11-20 09:24:18

swierzbicki
Member
Registered: 2014-11-19
Posts: 28

ToDataset produce corrupted data

Hello AB,

I'm getting weird issue with ToDataset function where produced dataset is corrupted.
Server is connected to a postgresql database using UniDAC library.

When using ToDataset function, string data is corrupted and fields have values from other fields

Here is my server code

  
    Var
    Props: TSQLDBConnectionProperties;
    HttpServer: TSQLDBServerAbstract;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Props := TSQLDBUniDACConnectionProperties.Create(
  TSQLDBUniDACConnectionProperties.URI(dPostgreSQL,'localhost'),
  'db', 'STEPH', 'me');
  HttpServer := TSQLDBServerHttpApi.Create(Props,'root','8080','user','pass' );
end;

Here is my client code

 
    Var
    fProps: TSQLDBConnectionProperties;


procedure TForm2.chkFromSQLClick(Sender: TObject);
var
  proxy: TSQLDBConnectionProperties;
  stmt: TSQLDBStatement;
  Timer: TPrecisionTimer;
begin
  ds1.DataSet.Free;
  Timer.Start;
  proxy := fProps;
  try
    proxy := TSQLDBWinHTTPConnectionProperties.Create('localhost:8080', 'root',
      'user', 'pass');

    stmt := proxy.NewThreadSafeStatement;
    try
      // stmt.Execute('select * from users where "User""=?',['STEPH']);
      stmt.Execute('select * from utilisateurs', true);
      if chkViaTClientDataSet.Checked then
        ds1.DataSet := ToClientDataSet(self, stmt)
      else
        ds1.DataSet := ToDataSet(self, stmt);
    finally
      stmt.Free;
    end;
  finally
    if proxy <> fProps then
      proxy.Free;
  end;
  lblTiming.Caption := 'Processed in ' + Ansi7ToString(Timer.Stop);
end;

Last edited by swierzbicki (2014-11-20 12:39:27)

Offline

#2 2014-11-20 09:32:40

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

Re: ToDataset produce corrupted data

Are you using the latest nightly build?
Ensure you included http://synopse.info/fossil/info/98535d019c

Offline

#3 2014-11-20 10:04:34

swierzbicki
Member
Registered: 2014-11-19
Posts: 28

Re: ToDataset produce corrupted data

Yes, I'm using the latest version...


I've also an "cosmetic" issue with TTime Fields that are displayed as TDateTime Fields

Offline

#4 2014-11-20 12:25:03

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Re: ToDataset produce corrupted data

Hi AB this is the same issue i have already reported !

Last edited by itSDS (2014-11-20 12:25:17)


Rad Studio 12.1 Santorini

Offline

Board footer

Powered by FluxBB