Access Database Design

Results 1 to 3 of 3

Thread: Access Database Design

  1. #1
    Troy the ASP Boy Guest

    Default Access Database Design

    I am using MS Access 97 with Active Server Pages on an NT Host. I am having problems finding recommendations for the design of my Access database.<BR><BR>My question is:<BR>Should I use separate fields or use one field and check the contents using server-side VBScript?<BR><BR>Here is an example:<BR><BR>Payment type: cash, credit card, check (user can choose any combination of these including none)<BR><BR>Option #1 - Separate Fields<BR>Fieldcash: yes/no<BR>Fieldcheck: yes/no<BR>Fieldcreditcard: yes/no<BR><BR>Option #2 - One Field<BR>Fieldpayment: check*cash*creditcard<BR>with this option i would use VBScript InStr to check the contents<BR><BR>Which way is better to use in terms of 1)database design 2)asp/database performance?<BR><BR>thanks :)<BR>

  2. #2
    Neil Popham Guest

    Default RE: Access Database Design

    IMHO, if your example is not simply hypothetical, then I would go with the three boolean fields, for two reasons:<BR><BR>* thats only three bits per record<BR>* easier to code, and therefore more easily passed on/gone back to<BR><BR>I recently did a database that needed approx. 40 checkboxes in three different categories. For this i used three text fields, labelled each value a two digit number and separated them with commas thus: 01,03,09,12,19 . I then used the &#039LIKE&#039 keyword in my SQL (eg: LIKE &#039%09%&#039) to search the three fields. I guess it all comes down to how many options you have - and how readable the code is gonna be - this being very important on larger ASP pages.<BR><BR>Another option may be some kind of binary code in a byte or integer numeric field: ie: cheque = 1, cash = 2 and creditcard = 4. In this example if the combination was &#039cheque and creditcard&#039 the field would equal 5. Individual values would be queried using AND, OR, etc<BR><BR>Go with the boolean fields though i reckon...

  3. #3
    Troy the ASP Boy Guest

    Default Will Use Separate Fields

    Thanks for the response Neil!<BR><BR>Based on your recommendation I will use 3 separate fields for my database. If I had 40 options within the recordset field then I would go with the InStr or Like.<BR><BR>

Posting Permissions

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