database app design question

This is a discussion on database app design question within the Windows Programming forums, part of the Platform Specific Boards category; Hi, A short introduction to the progam I'm working on. I have a Form View with combo boxes and edit ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    17

    database app design question

    Hi,

    A short introduction to the progam I'm working on. I have a Form View with combo boxes and edit contols. The combo boxes, Buyer & Seller, are populated with the contents of one the tables, Customer Table, in my data from my data.

    I also have an "Add" button on my form view. As you can guess, when the user clicks "Add" the contents of the combo boxes and edit controls are added to a record in "Transaction" table.

    The code I have now does work. The problem is that I have the steps that add the record into the database are in the Form View class instead of the the Record Set class. This I know is bad programming.

    The problem I can't figure out is how can I access the Combo boxes and Edit controls in a Form View class from a Record Set class. I guessing I will have to access the address of the Form View class.

    I was thinking:

    Code:
    void CCustomerTransactionView::OnTransaction()
    {
    
      UpdateData()
    
      CCustomerSet TmpSet;
      TmpSet.AddCustomer(Can't figure out what to pass here);
    
    }
    Thanks

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,702
    Whatever works for you.
    Code:
    TmpSet.AddCustomerFromTranView(this); //have CCustomerSet do the work
    //or 
    PopulateCustomerSet(TmpSet); //have CustomerTransactionView do the work
    gg

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    17

    Thanks gg

    Code:
    TmpSet.AddCustomerFromTranView(this);
    This is what I would like to try. The problem is implementing this function. I tried creating this function using "Add Member Function" In function type edit control I typed "void" and in Function Declaration I typed AddCustomerFromTranView(this)

    I got the following error message "Unable to create the implementation of this function.

    I then tried Function Declaration AddCustomerFromTranView(C...View* pView) This also generated error messages when I compiled the program.

    Could you give me some insight to what I'm not doing right here.

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,702
    This should work:
    >> void AddCustomerFromTranView(CCustomerTransactionView* pView);

    What are the compiler errors?

    gg

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    >> I then tried Function Declaration AddCustomerFromTranView(C...View* pView) This also generated error messages when I compiled the program.

    Make sure you have the headers included in the correct order.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. VS 2005 Database question
    By geek@02 in forum Windows Programming
    Replies: 1
    Last Post: 10-06-2008, 02:43 PM
  2. Class Design question.
    By g4j31a5 in forum C++ Programming
    Replies: 10
    Last Post: 11-08-2006, 10:28 PM
  3. program design question
    By Chaplin27 in forum C++ Programming
    Replies: 1
    Last Post: 06-23-2005, 08:18 PM
  4. GUI Design Question (Seeking an opinion)
    By Exile in forum C++ Programming
    Replies: 9
    Last Post: 02-10-2005, 07:47 AM
  5. simple database app. in borland c++ builder tutorial
    By kariem2k in forum C++ Programming
    Replies: 1
    Last Post: 09-26-2002, 08:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21