Access database


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Access database

  1. #1
    kristien Guest

    Access database



    I have two tables in my database one for
    Orders and OrderLines.

    One customer may have many order lines in one session which in turn populate
    the orders table as one record. . In a new session he orders again and
    once again the orderlines table gets populated by the customer's orders (multiple
    records) and in turn updates the order table.

    How can I access the orderlines table to make sure that I am only picking
    up the current orderlines for a particular session for a particular customer.
    as the customers previous orders will also be there. I need to know what
    the latest Autonumber is, I think or what do you think?

  2. #2
    Arthur Wood Guest

    Re: Access database


    Kristien,

    You should also have a Customers Tables. The Customers table's primary Key
    would be CustomerID. Then in the Orders Table, you would have a Primary
    Key (OrderID) and a Foreign Key (CustomerID) to connect an Order to the Customer
    placing that order. Similarly, in the OrderLines table you would have a
    Primary Key (OrderLineID) and a Foreign Key (OrderID) that would connect
    each OrderLIne to its Order (and thus to the Customer).

    Does this help? If not, then you need to be more specific as to the nature
    of your question.

    Arthur Wood


    "kristien" <kristien@webmail.co.za> wrote:
    >
    >
    >I have two tables in my database one for
    >Orders and OrderLines.
    >
    >One customer may have many order lines in one session which in turn populate
    >the orders table as one record. . In a new session he orders again and
    >once again the orderlines table gets populated by the customer's orders

    (multiple
    >records) and in turn updates the order table.
    >
    >How can I access the orderlines table to make sure that I am only picking
    >up the current orderlines for a particular session for a particular customer.
    >as the customers previous orders will also be there. I need to know what
    >the latest Autonumber is, I think or what do you think?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center