a beginner question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qazplm114477
    New Member
    • Oct 2008
    • 19

    #1

    a beginner question

    hello, i have just started to use visual basic a few days ago and im not good at programming. im currently doing my thesis and i was wondering if anyone could help me.

    I'm trying to create a database where when you save data in table1 it doesn't update the mainTable, but instead it updates another temporary table, but when i update the temporary table(which contains data from table1) it updates the mainTable. table1 and the mainTable have relations with each other.

    its like when i create a purchase order, i dont actually increase my inventory but when i receive the items from my purchase order, my inventory increases.

    Im using SQL server 2005 and vs2008

    Im not asking for the exact answer, if anyone has an example or a link to a tutorial or any kind of suggetions, it would be a great help. thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You need to implement the logic for all that.

    Comment

    • qazplm114477
      New Member
      • Oct 2008
      • 19

      #3
      Originally posted by debasisdas
      You need to implement the logic for all that.
      can you be a little bit more specific? do you mean like a logic server? sorry if i sound really newbish but i dont know much about visual basic.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        what is a logic server ?

        you need to implement the logic by using staging tables.

        Comment

        • reht
          New Member
          • Oct 2008
          • 1

          #5
          I think your query is as much to do with database design as programming.

          Using your example of purchase orders:

          You will have a table for holding Inventory data, ie name, code and stock-on-hand.

          You have a table of purchase orders and a table of purchase order details. Each detail record holds details of one inventory item, code and number of items to be purchased. The detail holds a link to the main purchase order. This link lets you find all of the details for the purchase order.

          Now in your program you will have to have a routine to add a purchase order and its details. Another routine, run when the order arrives, to update the main Inventory table's Stock-on-hand.

          The purchase order detail may hold a status field, which indicates whether the order has arrived or not. This can be checked to ensure that the syock-on-hand is not updated twice.

          I don't know if any of this helps you. I guess my main point is to get the database design sorted before you try to start coding.

          Comment

          Working...