Forum > Databases

Master Detail with SQlite3

(1/3) > >>

folkeu08:
Good morning all,
I started from an example of Master / Detail tables under SQLite3.
I don't want to use the DBNavigator component to manage the records of my tables.
I would like to replace it with 3 simple buttons: Add, Edit and delete.
It works great for the Master table.
I used the same method for the detail table but I get an error message when I want to add a city in record. It cannot find the City_mane field in the SQLQuery1 which corresponds to the master (countries) table or this field is in the Detail (Cities) table.
By forcing the recorder, the recording starts again and goes well. The new city attached to the country appears in the grid.
I attach my source to you, there may be something that escapes me.
Thank you
Francois

devEric69:

--- Quote from: folkeu08 on July 09, 2021, 11:36:39 am ---I don't want to use the DBNavigator component to manage the records of my tables.
I would like to replace it with 3 simple buttons: Add, Edit and delete.

--- End quote ---

Hello, (just for information, to be sure) did you know that you can make certain DBNavigator's buttons invisible?

folkeu08:
Yes but I just left the DBnavigator as in the original source of the example.
I don't want to use them at all.
Fran├žois

wp:
Then remove it. What's the problem?

Add your three buttons. Add a TActionList. Add these standard actions to the Actionlist: TDatasetEdit, TDatasetDelete, TDatasetInsert (or whatever you need); link the actions to your dataset. Put the actions into the Action property of the buttons - done.

folkeu08:
This is what I did indirectly with my 3 buttons.
It is the addition of a row in the detail table that goes wrong. I can't find the problem.

Navigation

[0] Message Index

[#] Next page

Go to full version