Recent

Author Topic: Creating Database Input forms Automatically  (Read 2011 times)

magu

  • New Member
  • *
  • Posts: 32
Creating Database Input forms Automatically
« on: December 31, 2021, 05:20:15 pm »
I have prepared a rudimentary dialog (TDbDialog) function that presents a dataset in a card format for editing purposes (as per attached screenshot).

The idea is to have an easy, quick and dirty system for generating data entry screens in lazarus for databases that is not a grid format.

The system works by going through the fields of a dataset and generating the proper components for each field.

Two main issues I am grappling with:
a. Is it possible to know the database type of the connection (eg. for a mysql/mariadb connection you can reuse the main db connection and simply create a new transaction; this is not possible for an SQlite db, so the different scenarios need to be handled somehow)
b. How would you go about creating lookup-components for those fields that have a limited set of options. Ideally I would want to allow a dev the opportunity to change the components generated by the system before the dialog is actually presented to the user.

Anyway all comments / suggestions on improving this would be greatly appreciated.

ps. if anyone knows of an existing solution for lazurus/fpc that I can use instead of reinventing the wheel please tell me!

pps. Wishing a very happy new year to everyone, hopefully this new one will be an improvement of the old...

 

TinyPortal © 2005-2018