473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

how to save multi-name into one field, and display only one

From my system, it allow product has multi-category, so I need to save
all
category names which one product belong to into one field on a
database,

and record saved like " nameA|nameB|nameC " - seperate by "|".
question 1:

the second time when i update the record for same product name, how to
have a record
like "nameA|nameB"
After multi-category name saved, then, i would like to generate a
navigate name with the link like
home > nameB > name of product
question2:

so how can i retrieved only one name from category field


Please post sample code.
thanks in advance.
Jul 19 '05 #1
1 1402
Putting multiple values into a single column is generally considered very
bad database design. It results in the problems you are encountering now.
You will also be unable to use simple SQL to do things like extract all
products belonging to a particular category.

You will have to use script code to extract the value that you desire once
you retrieve it from the database. Look at the VBScript Split function this
can return an array from which you pick the desired element. IE:

aName = Split("nameA|nameB", "|")
aName(0) would contain "nameA"
aName(1) would contain "nameB"

If it is at all possible you should restructure your database to not have
multiple values in a single column. Something like:

table products (product_id,...

table productnames( product_id, productname,...

For each new name you would add an entry to productnames.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"work4u" <ro*****@yahoo.com> wrote in message
news:9c**************************@posting.google.c om...
From my system, it allow product has multi-category, so I need to save
all
category names which one product belong to into one field on a
database,

and record saved like " nameA|nameB|nameC " - seperate by "|".
question 1:

the second time when i update the record for same product name, how to
have a record
like "nameA|nameB"
After multi-category name saved, then, i would like to generate a
navigate name with the link like
home > nameB > name of product
question2:

so how can i retrieved only one name from category field


Please post sample code.
thanks in advance.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
6
by: cody | last post by:
What are multi file assemblies good for? What are the advantages of using multiple assemblies (A.DLL+B.DLL) vs. a single multi file assembly (A.DLL+A.NETMODULE)?
5
by: bobwansink | last post by:
Hi, I'm relatively new to programming and I would like to create a C++ multi user program. It's for a project for school. This means I will have to write a paper about the theory too. Does anyone...
40
by: Mark G. Meyers | last post by:
http://www.savetheinternet.com There is more info and A PETITION at moveon... Easy to sign and give your two cents (and to your own reps in the process)....
2
by: Floortje | last post by:
Hi what is the best way to store a multi dimentional array for later. I dont know the 'shape' of the array in advance. Is writing to an XML file the best option ar are there better ways ? --...
8
by: paquer | last post by:
I'd like to provide an Export Function from my forms, where the User can choose the File name & save location Although I cannot get the "Save As" dialog box to open properly from access. What is...
0
by: Joseph I. Ceasar | last post by:
In an earlier post, someone asked about how to save a page on the client programmatically. I also had to solve this problem and did use Steven's approach. It worked great! Now here is an...
0
by: Joseph I. Ceasar | last post by:
In an earlier post, someone asked about how to save a page on the client programmatically. I also had to solve this problem and did use Steven's approach. It worked great! Now here is an...
0
by: Sabri.Pllana | last post by:
We apologize if you receive multiple copies of this call for papers. *********************************************************************** 2008 International Workshop on Multi-Core Computing...
2
by: Ahmed Yasser | last post by:
Hi All, i am doing a program where multi users are accessing the same database, each user can select records from the database and process them and have the results, at the same time other users can...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.