Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread Datasets empty after upgrade
Fri, Jun 7 2013 4:16 PMPermanent Link

Sergei Safar

Hi,

after upgrading from 1.01B5 to 1.02B1 my Datasets can not be populated anymore. I did a downgrade to 1.01B5 and the datasets are correctly populated after a Database.Load(myDataset) command;  

Am I missing something here?

Thank you.

best regards,
Sergei Safar
Sat, Jun 8 2013 2:54 AMPermanent Link

Matthew Jones

<Sergei Safar> wrote:
> Hi,
>
> after upgrading from 1.01B5 to 1.02B1 my Datasets can not be populated
> anymore. I did a downgrade to 1.01B5 and the datasets are correctly
> populated after a Database.Load(myDataset) command;  
>
> Am I missing something here?
>
> Thank you.
>
> best regards,
> Sergei Safar

I imagine that more detail may help get a resolution.

--

Matthew Jones
Sun, Jun 9 2013 9:22 AMPermanent Link

Sergei Safar

Hi Matthew,

here is just a piece of code:

  Button1: TButton;   
  DSCity : TDataset;
  Grid1 : TGrid;

procedure TForm1.Button1Click(Sender: TObject);
begin
  DSCity.Open;
  DSCity.Params.Clear;
  DSCity.Params.Add('State=all');
  Database.BaseUrl := '/view/loadcity.php';
  Database.Load(DSCity);
end;

procedure TForm1.DSCityAfterLoad(Sender: TObject);
begin
  if DSCity.RowCount = 0 then begin
     ShowMessage('No cities avaiable');
  end;
end;

The loadcity.php returns data in Jason format.  This works fine when my app is compiled in EWB 1.01B5, but when compiled in EWB 1.02B1 the dataset DSCity is always empty, i.e., the Grid1 is empty, no data.

Recompiled my app again with 1.01B5 and the Grid1 shows all data.

Hope that helps.

Best regards,
Sergei Safar
Mon, Jun 10 2013 4:55 AMPermanent Link

Matthew Jones

I imagine that the JSON changed slightly in the update. I note that the update info
says you can retrieve and load the JSON, so perhaps a quick hack to load some test
data and retrieve the JSON to see how it looks, and compare against the format your
PHP is generating might reveal the answer?

/Matthew Jones/
Mon, Jun 10 2013 6:05 AMPermanent Link

Uli Becker

Sergei,

>     DSCity.Open;
>     DSCity.Params.Clear;
>     DSCity.Params.Add('State=all');

Is "all" a string? Then the missing quotes could be the problem:

DSCity.Params.Add('State=''all''');

Uli
Mon, Jun 10 2013 9:54 AMPermanent Link

Sergei Safar

Ulrich,

thanks for the reply. The statement

DSCity.Params.Add('State=all');

works fine and PHP "understands" the parameter State via statement:

<?php
...
$selstate = $_REQUEST["State"];
...
?>

I seems that the problem is regarding jason format in this new version of EWB.

Best regards,
Sergei Safar
Mon, Jun 10 2013 10:34 AMPermanent Link

Sergei Safar

Matthew,

I found the problem. The problem is a field that is TINYINT in MySql and dtBoolean in Dataset. For some reason, the Dataset is not loaded in this case. I changed dtBoolean to dtInteger and the Dataset is loading correctly. MySQL do not have boolean fields and I am using TINYINT fields. The strange is that in the prior version of EWB (1.01B5) the dataset is loaded anyway.

Best regards,
Sergei Safar
Mon, Jun 10 2013 1:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sergei,

<< I found the problem. The problem is a field that is TINYINT in MySql and
dtBoolean in Dataset. For some reason, the Dataset is not loaded in this
case. I changed dtBoolean to dtInteger and the Dataset is loading correctly.
MySQL do not have boolean fields and I am using TINYINT fields. The strange
is that in the prior version of EWB (1.01B5) the dataset is loaded anyway.
>>

Were you seeing an error at runtime with the EWB application (browser-side)
?  You should see an error about the value not being a correct boolean
value.  The StrToBool function changed so that it raise an exception when
the values aren't either "True" or "False".  Before, the result would just
be set to False, even if the input value was '1'.

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com


Fri, Jun 14 2013 8:28 AMPermanent Link

Sergei Safar

Tim,

"You should see an error about the value not being a correct boolean value."

No exception is raised in this situation. When this occurs, i.e., a field of type INTEGER at database side and BOOLEAN at TDataSet side and the following statement is executed (Database.Load(Dataset)Wink the Dataset remains empty.

If you change the field type from BOOLEAN to INTEGER at Dataset side, everything works fine.


Best regards,
Sergei Safar
Image