Recent

Author Topic: Can't call TBufDataSet.CreateDataSet at design time?  (Read 771 times)

egsuh

  • Hero Member
  • *****
  • Posts: 688
Can't call TBufDataSet.CreateDataSet at design time?
« on: December 10, 2020, 06:38:52 am »
I have to run the program to createdataset. Hope a menu item of "CreateDataset" is added to popup menu of TBufDataSet icon.

Thaddy

  • Hero Member
  • *****
  • Posts: 10748
Re: Can't call TBufDataSet.CreateDataSet at design time?
« Reply #1 on: December 10, 2020, 09:32:17 am »
Why?
There is a strict separation of design and actual code.

egsuh

  • Hero Member
  • *****
  • Posts: 688
Re: Can't call TBufDataSet.CreateDataSet at design time?
« Reply #2 on: December 11, 2020, 07:27:34 am »
When I design a form to edit table,  I need actual table so that I can connect data controls and fields of the table. Just dropping a TBufDataSet icon and defining FieldDefs is not sufficient to do that. The dataset must be created, and I hope this is possible at design time.  This function is especially useful when I design both of table structure and operations on the table at the same time, because I have to change the definition of fields frequently as needed.

It's something like the Database Desktop of old Delphi. And TClientDataSet provides that function, AFAIK.

wp

  • Hero Member
  • *****
  • Posts: 8315
Re: Can't call TBufDataSet.CreateDataSet at design time?
« Reply #3 on: December 11, 2020, 12:15:37 pm »
Hope a menu item of "CreateDataset" is added to popup menu of TBufDataSet icon.
It is, in FPC trunk.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

lucamar

  • Hero Member
  • *****
  • Posts: 3779
Re: Can't call TBufDataSet.CreateDataSet at design time?
« Reply #4 on: December 11, 2020, 12:20:22 pm »
@egsuh: You do know that Lazarus also has a Database Desktop, don't you? It's in {Lazarus folder}/tools/lazdatadesktop/ :)
« Last Edit: December 11, 2020, 12:21:56 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

egsuh

  • Hero Member
  • *****
  • Posts: 688
Re: Can't call TBufDataSet.CreateDataSet at design time?
« Reply #5 on: December 12, 2020, 04:29:14 am »
Quote
It is, in FPC trunk.
Wow, they are great news! 

@Lucamar: I didn't know that. Is there any way to add it in the Lazarus IDE menu, like as a submenu of Tools?

wp

  • Hero Member
  • *****
  • Posts: 8315
Re: Can't call TBufDataSet.CreateDataSet at design time?
« Reply #6 on: December 12, 2020, 11:02:18 am »
Is there any way to add it in the Lazarus IDE menu, like as a submenu of Tools?
You can add any external program to the Tools menu by using "Tools" > "Configure External Tools"
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

 

TinyPortal © 2005-2018