Solved

DBGrid records order

Posted on 1998-08-13
5
153 Views
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
0
Comment
Question by:oberdan
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
can you give an example?
0
 

Author Comment

by:oberdan
Comment Utility
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.

0
 
LVL 3

Expert Comment

by:rickpet
Comment Utility
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

Rick
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
yep, rickpet has a good solution
0
 
LVL 3

Accepted Solution

by:
rickpet earned 100 total points
Comment Utility
Are you having any other problems with this?

I hope this solved your problem...

Rick
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 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

16 Experts available now in Live!

Get 1:1 Help Now