Solved

DBGrid records order

Posted on 1998-08-13
5
156 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
ID: 1362009
can you give an example?
0
 

Author Comment

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

0
 
LVL 3

Expert Comment

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

Rick
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1362012
yep, rickpet has a good solution
0
 
LVL 3

Accepted Solution

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

I hope this solved your problem...

Rick
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 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