Recent

Author Topic: Form creator for editing a table?  (Read 1828 times)

krzynio

  • Full Member
  • ***
  • Posts: 103
    • Krzynio's home page
Form creator for editing a table?
« on: December 05, 2023, 10:13:48 am »
Hi!
Is there a creator for database editing form for Lzarsus?
I want to automatically create a form with controls: label + dbedit or edit for all fields in a table.
« Last Edit: December 05, 2023, 10:16:17 am by krzynio »
Ubuntu 23.10 x64, / Windows 11 PL - latest updates
Lazarus 2.2.6, FPC 3.2.2

Nicole

  • Hero Member
  • *****
  • Posts: 1009
Re: Form creator for editing a table?
« Reply #1 on: December 15, 2023, 04:55:26 pm »
Not sure, what you want.
Please search e.g. for

DBStringGrid
IBExperts

kwyan

  • New Member
  • *
  • Posts: 25
Re: Form creator for editing a table?
« Reply #2 on: December 16, 2023, 11:34:50 am »
I think you want:

Create a form in IDE but the TLabel and TDBEdit are created dynamically by Pascal logic (instead of using IDE to put these components in the form) based on the columns in a databae table?

If you want to do this, you need to know:
1. How to create components using the Pascal language (e.g. starts with TLabel.Create(self)).
2. Loop the TFields in an active TSqlQuery (or TDataset) to create TDBEdit.
3. Assuming your field display name is meaningful, you can use Field.DisplayName for the TLabel.Caption.

I don't not if there is any existing library with this function.
« Last Edit: December 16, 2023, 04:17:36 pm by kwyan »

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Form creator for editing a table?
« Reply #3 on: December 16, 2023, 11:50:08 am »
You also might consider creating once your TForm as a TFrame and reuse it as often you like to.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Dzandaa

  • Sr. Member
  • ****
  • Posts: 389
  • From C# to Lazarus
Re: Form creator for editing a table?
« Reply #4 on: December 16, 2023, 03:58:44 pm »
Hi,

I have created a template for my own usage that create a Form DB style address book (sqlite)

You can try it out and modify it for your own use.

Just put the directory CreateDB in your template directory.

B->
Regards,
Dzandaa

papuccio

  • Newbie
  • Posts: 1
Re: Form creator for editing a table?
« Reply #5 on: December 16, 2023, 10:45:00 pm »
Lazsqlx? It has an example data entry generator.
Sorry :I'm reading it now: Avra has already mentioned it in another post

 

TinyPortal © 2005-2018