Insert/reading multiple values

Results 1 to 2 of 2

Thread: Insert/reading multiple values

  1. #1
    JvG Guest

    Default Insert/reading multiple values

    I currently have a database up and running nicely, and I want to extend it a bit but have run up against the following problem.<BR><BR>I want to add the ability where an object can belong to multiple categories. E.g., an article can be in the review category, but also in the news category. I tried a text field, with a comma delimiter, but this produces errors.<BR><BR>Can anyone give me an example of how to store and retrieve multiple values in a single access database cell? I&#039ve looked all over for some tutorial on this, but found none.

  2. #2
    Join Date
    Dec 1969

    Default RE: Insert/reading multiple values

    Well, here&#039s how you would do it, not that I would suggest it:<BR><BR>1. Get your data from the table.<BR>2. Search for the , which seperates the identifiers.<BR>3. Use Mid and Len to grab the first number, move to the ",", grab the second number and so on.<BR><BR>You can find out more about mid and len in the scripting technologies on Microsoft&#039s web site.<BR><BR><BR>Now, here&#039s how I would do it. It&#039s in the structure of the database itself.<BR><BR>1. If you need a reference to a record in another table, then add another filed in your current table.<BR>2. When you start adding records you can always pull information from another table to determine if you need a reference in this table.<BR>3. Let say you have table A, which contains basic information about your house.<BR>4. Table B has information about the furniture in your house. But how are you going to tell which funiture belongs to which house? Easy.<BR>5. When ever you insert information about your house, you should always generate an autoincrementing record number. This is how you will link the information from table to table. <BR>6. When you insert information into Table B, you should also insert which record number from Table A it belongs to.<BR><BR>That&#039s what a relational database is all about. Building a database should never be one table, unless it&#039s a really small database. You tables should have some way of showing a relationship.<BR><BR>Brian

Posting Permissions

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