[Lazarus] TBufDataset issues

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] TBufDataset issues

Free Pascal - Lazarus mailing list
Playing with TBufDataset I came across some issues:

(1) Creating fields at designtime: In order to create fields at
designtime to a new TBufDataset component I add FieldDefs by clicking
the '...' next to "FieldDefs" in the Object Inspector and fill in the
required data. But there is no way to really *create* the dataset. At
runtime I would call BufDataset.CreateDataset - but this is not
accessible at designtime. In Delphi's ClientDataset there is an item
"Create dataset" in the context menu of the dataset. This seems to be
missing here.

OK - I can create the dataset at runtime at least. This leads to the
second problem:

(2) Persistent fields: Wanting to create persistent fields at design
time I do this: Make sure that the BufDataset is active. Right-click on
the component to add the Fields Editor. I see the fields created. But
how do I make them persistent? In Delphi I select both fields and click
the '+'. Here the field list which opens is empty and the "Create"
button is disabled. In other datasets everything is working correctly
here, but TBufDataset seems to be incomplete.

Michael, is this your component? Could you have a look? I can write a
bug report, if necessary.


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TBufDataset issues

Free Pascal - Lazarus mailing list


On Thu, 23 Apr 2020, Werner Pamler via lazarus wrote:

> Playing with TBufDataset I came across some issues:
>
> (1) Creating fields at designtime: In order to create fields at
> designtime to a new TBufDataset component I add FieldDefs by clicking
> the '...' next to "FieldDefs" in the Object Inspector and fill in the
> required data. But there is no way to really *create* the dataset. At
> runtime I would call BufDataset.CreateDataset - but this is not
> accessible at designtime. In Delphi's ClientDataset there is an item
> "Create dataset" in the context menu of the dataset. This seems to be
> missing here.

I will add one;

>
> OK - I can create the dataset at runtime at least. This leads to the
> second problem:
>
> (2) Persistent fields: Wanting to create persistent fields at design
> time I do this: Make sure that the BufDataset is active. Right-click on
> the component to add the Fields Editor. I see the fields created. But
> how do I make them persistent? In Delphi I select both fields and click
> the '+'. Here the field list which opens is empty and the "Create"
> button is disabled. In other datasets everything is working correctly
> here, but TBufDataset seems to be incomplete.

> Michael, is this your component? Could you have a look? I can write a
> bug report, if necessary.

I will have a look.

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TBufDataset issues

Free Pascal - Lazarus mailing list


On Thu, 30 Apr 2020, Michael Van Canneyt via lazarus wrote:

>
>
> On Thu, 23 Apr 2020, Werner Pamler via lazarus wrote:
>
>> Playing with TBufDataset I came across some issues:
>>
>> (1) Creating fields at designtime: In order to create fields at
>> designtime to a new TBufDataset component I add FieldDefs by clicking
>> the '...' next to "FieldDefs" in the Object Inspector and fill in the
>> required data. But there is no way to really *create* the dataset. At
>> runtime I would call BufDataset.CreateDataset - but this is not
>> accessible at designtime. In Delphi's ClientDataset there is an item
>> "Create dataset" in the context menu of the dataset. This seems to be
>> missing here.
>
> I will add one;

Added in rev. 63093.

I added several menus:
- Create dataset (what you need)
- Save data to file (allows to save data in memory to file)
- Load data from file (allows to load data from a file into memory)
- Copy data from another dataset (what it says on the tin :-))

>
>>
>> OK - I can create the dataset at runtime at least. This leads to the
>> second problem:
>>
>> (2) Persistent fields: Wanting to create persistent fields at design
>> time I do this: Make sure that the BufDataset is active. Right-click on
>> the component to add the Fields Editor. I see the fields created. But
>> how do I make them persistent? In Delphi I select both fields and click
>> the '+'. Here the field list which opens is empty and the "Create"
>> button is disabled. In other datasets everything is working correctly
>> here, but TBufDataset seems to be incomplete.
>
>> Michael, is this your component? Could you have a look? I can write a
>> bug report, if necessary.
>
> I will have a look.

Works fine here, be sure to set correct properties for the fields you add.
If any of the fields has incorrectly configured properties, it won't work.

But I did this when the dataset was not yet active. Maybe that is your
problem.

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TBufDataset issues

Free Pascal - Lazarus mailing list
Am 30.04.2020 um 10:45 schrieb Michael Van Canneyt via lazarus:
> I added several menus:
> - Create dataset (what you need)
> - Save data to file (allows to save data in memory to file)
> - Load data from file (allows to load data from a file into memory) -
> Copy data from another dataset (what it says on the tin :-))
Thank you.

>>> (2) Persistent fields: Wanting to create persistent fields at design
>>> time I do this: Make sure that the BufDataset is active. Right-click
>>> on the component to add the Fields Editor. I see the fields created.
>>> But how do I make them persistent? In Delphi I select both fields
>>> and click the '+'. Here the field list which opens is empty and the
>>> "Create" button is disabled. In other datasets everything is working
>>> correctly here, but TBufDataset seems to be incomplete.
> Works fine here, be sure to set correct properties for the fields you
> add.
> If any of the fields has incorrectly configured properties, it won't
> work.
>
> But I did this when the dataset was not yet active. Maybe that is your
> problem.
Although I had it working some time after I had sent my mail I now have
the same issue again and I don't know why- see attached demo. I had
entered two field defs, clicked the new "CreateDataset" option (which
automatically set the Dataset to Active, however, not immediately, only
after clicking somewhere else). I saved the project in this state. When
you load it into Lazarus you must first create the dataset again,
because i did not specify a filename since it must be absolute and won't
fit to your directory structure. The FieldsEditor and trying to add
persistent fields always leads me to the state with the empty field list
and disabled "Create" button.

I should note also that when I experimented with FileName specified the
IDE was in a pretty unstable state and crashed easily. I cannot
reproduce, however, what I did exactly. But it happened rather
frequently, at some stage the IDE crashed when I tried to click off the
Active property, but this was gone after I reloaded the project.



--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

bufdataset_designtime_created.zip (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TBufDataset issues

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
There's another design-time related issue with AutoInc fields: see forum
post
https://forum.lazarus.freepascal.org/index.php/topic,49614.msg360102.html#msg360102.
The post contains a small demo to show the issue.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TBufDataset issues

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


On Fri, 1 May 2020, Werner Pamler via lazarus wrote:

> Am 30.04.2020 um 10:45 schrieb Michael Van Canneyt via lazarus:
>> I added several menus:
>> - Create dataset (what you need)
>> - Save data to file (allows to save data in memory to file)
>> - Load data from file (allows to load data from a file into memory) - Copy
>> data from another dataset (what it says on the tin :-))
> Thank you.
>
>>>> (2) Persistent fields: Wanting to create persistent fields at design time
>>>> I do this: Make sure that the BufDataset is active. Right-click on the
>>>> component to add the Fields Editor. I see the fields created. But how do
>>>> I make them persistent? In Delphi I select both fields and click the '+'.
>>>> Here the field list which opens is empty and the "Create" button is
>>>> disabled. In other datasets everything is working correctly here, but
>>>> TBufDataset seems to be incomplete.
>> Works fine here, be sure to set correct properties for the fields you add.
>> If any of the fields has incorrectly configured properties, it won't work.
>>
>> But I did this when the dataset was not yet active. Maybe that is your
>> problem.
>
> Although I had it working some time after I had sent my mail I now have the
> same issue again and I don't know why- see attached demo. I had entered two
> field defs, clicked the new "CreateDataset" option (which automatically set
> the Dataset to Active, however, not immediately, only after clicking
> somewhere else).

You must do this when the dataset is NOT yet created.

I tried that and it works fine.

When the dataset is created, the fields editor shows the fields, as it
should. But they are not persistent. In order to make the fields persistent,
the dataset may not be empty.

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TBufDataset issues

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


On Fri, 1 May 2020, Werner Pamler via lazarus wrote:

> There's another design-time related issue with AutoInc fields: see forum
> post
> https://forum.lazarus.freepascal.org/index.php/topic,49614.msg360102.html#msg360102.
> The post contains a small demo to show the issue.

I fixed it, it is merged to 3.2.

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus