Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Runtime dataset creation - 2.06
Wed, Apr 11 2018 3:52 PMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi All,

I am in process of migrating from 2.04 to 2.06, and have left 2 issues,
one with creating a dataset runtime.

Following from 2.04:

   XXdataset:=TDataSet.Create(nil);
   with XXdataset.Columns.Add do
   begin
   Name:='Item';
   DataType:=dtString;
   Length:=25;
   end;
   with XXdataset do begin
   OnRowChanged := XXdatasetRowChanged;
   Open;
   end;

XXdataset:=TDataSet.Create(nil) makes it global, but how can I use it in
the new setup with named database?

I have defined XXDatabase in database unit, but i cannot simply do
XXdataset:=TDataSet.Create(XXDatabase);

and tried other options (create dataset on oncreate event of xxdatabase
etc), i am obviously doing something wrong, but what?

Thanks in advance.

Regards,

Hüseyin
Thu, Apr 12 2018 3:25 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Hseyin,

<< I am in process of migrating from 2.04 to 2.06, and have left 2 issues, one with creating a dataset runtime.

XXdataset:=TDataSet.Create(nil) makes it global, but how can I use it in the new setup with named database?

I have defined XXDatabase in database unit, but i cannot simply do XXdataset:=TDataSet.Create(XXDatabase); >>

You *must* create each dataset with the owning database passed as the Owner parameter, otherwise the dataset won't be hooked up to the proper database.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Apr 12 2018 3:35 PMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi Tim,

Thanks for the reply, i have tried following:

XXdataset:=TDataSet.Create(XXDatabase);

XXdataset:=TDataSet.Create('XXDatabase');

XXdataset:=TDataSet.Create(TXXDatabase);

XXdataset:=TDataSet.Create(databaseunit.XXDatabase);

XXdataset:=TDataSet.Create(databaseunit.'XXDatabase');

XXdataset:=TDataSet.Create(databaseunit.'TXXDatabase');

i cannot satisfy the compiler Smile

Regards,
Hüseyin

Den 12-04-2018 kl. 21:25 skrev Tim Young [Elevate Software]:
> Hüseyin,
>
> << I am in process of migrating from 2.04 to 2.06, and have left 2 issues, one with creating a dataset runtime.
>
> XXdataset:=TDataSet.Create(nil) makes it global, but how can I use it in the new setup with named database?
>
> I have defined XXDatabase in database unit, but i cannot simply do XXdataset:=TDataSet.Create(XXDatabase); >>
>
> You *must* create each dataset with the owning database passed as the Owner parameter, otherwise the dataset won't be hooked up to the proper database.
>
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
Mon, Apr 16 2018 10:26 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Hseyin,

<< i cannot satisfy the compiler Smile>>

What's the compiler error message ?  It should *tell* you exactly what the issue is.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Apr 16 2018 6:38 PMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Tim,

This seems to be working now also, strange because i think i've tried
following before and without success but now it compiles and run fine:

xxruntime :=TDataSet.Create(myDatabase);

myDatabase are defined as TDatabase within database unit. I must have
missed something before or added something while troubleshooting which
makes it work now.

Regards,
Hüseyin

Den 16-04-2018 kl. 16:26 skrev Tim Young [Elevate Software]:
> Hüseyin,
>
> << i cannot satisfy the compiler Smile>>
>
> What's the compiler error message ?  It should *tell* you exactly what the issue is.
>
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
Image