Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-26-2017, 12:45 AM
larshgf larshgf is offline
Senior Member
 
Join Date: Jan 2001
Posts: 236
Default How to edit tables in a realtional database?

Hi,

I am working on a dictionary program containing a database made by 3 tables....
- Lemma (Headword, Grammar etc)
- Sense (meaning of word and more)
- Sentences (frases, sentences and so on)

This is a relational database. The Sense and Sentence tables are both detail-tables related to the master-table lemma.

New words are added to the database with senses and sentences. Sometimes I want to edit in the data and maybee add or delete a sense or a sentence.

How do you usually edit a relational database if you do not want to do it through dbgrids? I find dbgrids are not so pretty and they make - in my opinion - a bad looking userinterface.
Do you use queries or how do you manage to do it?

A direct answer or a link to a good example with Delphi code would be very wellcome :-)

Best Regards
Lars
Reply With Quote
  #2  
Old 01-26-2017, 03:26 AM
GeoWink GeoWink is offline
Senior Member
 
Join Date: Jan 2001
Posts: 880
Default

One way is to read the data and transfer these data to TEdits and display them on a panel you set up as you like. You can change any data. Put on an Accept Button and a Cancel Button and go to it.
Reply With Quote
  #3  
Old 01-26-2017, 08:39 AM
larshgf larshgf is offline
Senior Member
 
Join Date: Jan 2001
Posts: 236
Default

Thank you.
So what you propose is: when I save the editet values I run through the two detail tables (using "while not ADOTable. eof do... etc) , find the relevant records by using the master field ID, and assign the changed values. So if I have added new records they have to be appended after having identified them as new.
Do you know if this is a" normal" way to solve this problem? Might SQL be a solution?
Reply With Quote
  #4  
Old 01-26-2017, 04:08 PM
GeoWink GeoWink is offline
Senior Member
 
Join Date: Jan 2001
Posts: 880
Default

This is how I do it. Right or wrong, it works well for me. Not sure what you mean by SQL solution since I am using SQL to get the values. Yes, you can add a new record by putting a label on the Panel that says NEW RECORD which when clicked would clear the TEDits and let you fill in each value. Clicking NEW RECORD sets a parameter which indicates it is new so that when you click Accept it knows to add a new record. Make sense?? Hope this helps...

George
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:01 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.