Results 1 to 6 of 6

Thread: Design Issue

  1. #1
    Join Date
    Nov 2005
    Posts
    6

    Question Unanswered: Design Issue

    I posted this also in the Visual Basic section:

    I'm working with: VB6 and SqlServer 2000

    I'm creating an application that requires users to answer several questions and based on answers to those questions, certain conditions result, such as the ability to view certain sections of the questionaire and/or more questions appear and/or some questions become irrelavent and/or mathematical formulas work one way or another based on an answer to a question.

    Here is an example:
    The user has to answer a question. For this particular question, if the user chooses Yes then I must "Activate" all of the questions that are flagged with the code X. If the user chooses No then I must "Activate" all of the questions that are flagged with Y and "Deactivate" all of the questions that are flagged with Z.

    I'm coming across a design issue (both with the application itself and the database). What is the best way to store all of this in a database? Should I store the questions along with the list of possible answers and their corresponding conditions in the database as well as the actual data for each record (each questionaire)? Should I be referencing the database to populate all of my questions on my VB form or should I manually put labels and combo boxes containing the questions and possible answers on my form? Or should I be using another technology to store my questions and conditions OR my results, such as XML?

    I looking for suggestions. I want to optimize my program as much as possible. I don't want to slow it down by making several calls to the database, but I want to make sure I'm also taking away optimization by hardcoding everything.

    Thanks for your time and help!

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by jbee1301
    Should I store the questions along with the list of possible answers and their corresponding conditions in the database as well as the actual data for each record (each questionaire)? Should I be referencing the database to populate all of my questions on my VB form or should I manually put labels and combo boxes containing the questions and possible answers on my form?
    I would always choose storing reference data in a database over hard-coding in the application.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Nov 2005
    Posts
    6
    blindman,

    thanks for responding. i had a feeling that would be the best option. i'm still a bit confused on how to logically put everything in the database.

    MORE INFO:

    Picture an application with an explorer style view. On the left in folders are different sections of a questionaire. On the right side will be the corresponding questions to that section. Each section, each question and it's corresponding possible answers, the controls that they will be held in (VB) will all need to be in the database. I'm still confused on how to setup tables relating each part...There is the data that will be stored to set up the screen, then there is data that will be stored for each record (each questionaire's answers, so to speak).

    Thanks again!

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Code:
    questionaire
    	section
    		question
    			answers
    ...but what do you mean , "the controls that they will be held in (VB) will all need to be in the database"? I hope you are just referring to the lookup lists...
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Nov 2005
    Posts
    6
    i think i was thinking too much. Seeing your code example has helped me clear up a lot. Thank you!...I was adding in a bunch of tables that didn't need to be there. The structure above makes a lot more sense, and will work with all of the lookup tables that I'll need. Again Thank you!...it always helps to have another set of eyes looking at the same issue.

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by jbee1301
    Again Thank you!...it always helps to have another set of eyes looking at the same issue.
    blind ones at that
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •