DBGrid records order

Posted on 1998-08-13
Last Modified: 2010-04-04
I need to build a sistem that uses something like a Orders/Items tables relationship, with a DBGrid to store the Items data. But the typed records order Must not be changed. Something like to ignore the Items index. The typing order must not be changed
Question by:oberdan
  • 2
  • 2

Expert Comment

ID: 1362009
can you give an example?

Author Comment

ID: 1362010
My english is really bad... I'll try to explain.

In my Items table the recods are indexed by Item number. For each Order I'll haveone customer and several items.

I type the customer number and after I will type the items.
If in my items table I have:
I hope this helps you.
     ItemNo       Description
       1          Item 1
       2          Item 2
       3          Item 3
but in my Order I type 3, 1, 2, this sequence must not be changed.


Expert Comment

ID: 1362011
Create another table...we'll call it OrderDetail
This table will hold your Order's Detail info and will have a unique id...OrderDetail_id of type integer. This will be your primary index/key.  As the user inserts an item you generate a unique id for each item...

Order (master table)
  Order_id: integer key
  Customer_id: integer

OrderDetail (detail table)
  OrderDetail_id: integer key
  Order_id: integer key
  Item_id: integer
  Quantity: float


Expert Comment

ID: 1362012
yep, rickpet has a good solution

Accepted Solution

rickpet earned 100 total points
ID: 1362013
Are you having any other problems with this?

I hope this solved your problem...


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With  eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now