473,791 Members | 2,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing Text Values Instead of ID's for the Sake of Users

Hi all. I'm creating a FE/BE database that will be used by about 6 users. As
usual, I have several fields, such as "OrganizationTy peID" that will get
values (via combo boxes in forms) from separate lookup tables. I know the
'correct' way to do this, using a long integer as the field type. In this
case, however, I am considering doing it "incorrectl y", by actually storing
the text in my field rather than an ID, still using a lookup table, but
joining on the text and using cascading updates. I'm considering this
because the users are going to want to create their own queries and reports,
and it might be less confusing for them if they don't have to join to the
lookup tables all the time. It seems to me that the main disadvantages will
be the extra storage requirements (1 byte per character vs. 4 bytes per long
int) and the speed of data transfer. I think I can deal with integrity
issues with the cascading updates, but I haven't tried this before.

I'm asking to see if any experienced developers have done this same thing
with ok results, or if anyone has ideas against it that I haven't thought
of.
(I'm a pretty experienced Access developer)

thanks
-John
Mar 17 '06 #1
14 1812
My experience is that lookup fields are ONLY useful for end-users displaying
data in datasheet view. In any other circumstance, they are more trouble
than they ever were worth to that novice/casual end user. IMNSHO, you will
be far better off to replace the Lookup Fields with a field containing the
Foreign Key and give the users some free training on Queries and Joins. Even
if you donate normally-paid consulting time, it'll pay you back in the long
run, when you aren't regularly getting phone calls from confused users.

That said, it is possible to redefine the Lookup Fields so that they appear
to do what you describe. But beware the day that users start to create
Queries on the Table -- that will be a good time to have folded your tent
and stolen away into the night.<GRIN>

Larry Linson
Microsoft Access MVP

"John Welch" <john(remove)we lch@cal(remove) central.com> wrote in message
news:dv******** @enews2.newsguy .com...
Hi all. I'm creating a FE/BE database that will be used by about 6 users.
As usual, I have several fields, such as "OrganizationTy peID" that will
get values (via combo boxes in forms) from separate lookup tables. I know
the 'correct' way to do this, using a long integer as the field type. In
this case, however, I am considering doing it "incorrectl y", by actually
storing the text in my field rather than an ID, still using a lookup
table, but joining on the text and using cascading updates. I'm
considering this because the users are going to want to create their own
queries and reports, and it might be less confusing for them if they don't
have to join to the lookup tables all the time. It seems to me that the
main disadvantages will be the extra storage requirements (1 byte per
character vs. 4 bytes per long int) and the speed of data transfer. I
think I can deal with integrity issues with the cascading updates, but I
haven't tried this before.

I'm asking to see if any experienced developers have done this same thing
with ok results, or if anyone has ideas against it that I haven't thought
of.
(I'm a pretty experienced Access developer)

thanks
-John

Mar 18 '06 #2
Thanks Larry. I can't tell if we're talking about the same thing, though.
I'm _not_ thinking of using "lookup fields" in the sense of using Access'
confusing built in thing where the field stores a number but displays text.
I'm thinking of having the field actually store text and having the text be
the foreign key to the lookup table which has text as it's primary key.

For example:
tblOrganization s:
OrgID: autonum
OrgName: text
OrgType (fk): text (foundation, household, corporation, etc.)

tblOrgTypes:
OrgType (pk): text (foundation, household, corporation, etc.)

join with cascading updates
-John
"Larry Linson" <bo*****@localh ost.not> wrote in message
news:j4JSf.2986 $TK2.1012@trndd c07...
My experience is that lookup fields are ONLY useful for end-users
displaying data in datasheet view. In any other circumstance, they are
more trouble than they ever were worth to that novice/casual end user.
IMNSHO, you will be far better off to replace the Lookup Fields with a
field containing the Foreign Key and give the users some free training on
Queries and Joins. Even if you donate normally-paid consulting time, it'll
pay you back in the long run, when you aren't regularly getting phone
calls from confused users.

That said, it is possible to redefine the Lookup Fields so that they
appear to do what you describe. But beware the day that users start to
create Queries on the Table -- that will be a good time to have folded
your tent and stolen away into the night.<GRIN>

Larry Linson
Microsoft Access MVP

"John Welch" <john(remove)we lch@cal(remove) central.com> wrote in message
news:dv******** @enews2.newsguy .com...
Hi all. I'm creating a FE/BE database that will be used by about 6 users.
As usual, I have several fields, such as "OrganizationTy peID" that will
get values (via combo boxes in forms) from separate lookup tables. I know
the 'correct' way to do this, using a long integer as the field type. In
this case, however, I am considering doing it "incorrectl y", by actually
storing the text in my field rather than an ID, still using a lookup
table, but joining on the text and using cascading updates. I'm
considering this because the users are going to want to create their own
queries and reports, and it might be less confusing for them if they
don't have to join to the lookup tables all the time. It seems to me that
the main disadvantages will be the extra storage requirements (1 byte per
character vs. 4 bytes per long int) and the speed of data transfer. I
think I can deal with integrity issues with the cascading updates, but I
haven't tried this before.

I'm asking to see if any experienced developers have done this same thing
with ok results, or if anyone has ideas against it that I haven't thought
of.
(I'm a pretty experienced Access developer)

thanks
-John


Mar 18 '06 #3
Yep! Example ... the account for a transaction. There are only a dozen
accounts or so, and thousands of transactions. But the account name is
stored in the transaction table, not the ID of some account from an
Accounts table. The Transactions form still has a pulldown for
accounts, it just references the Transactions table itself, "SELECT
DISTINCT Account From Transactions ORDER BY Account". Actually I do
something similar for details except its WHERE COUNT whatever over the
last three months > 2.
I'd like to tell you of all the problems I have had with this over the
past ten years or so because I'm a strong relational db kinda guy. But
I can't because I haven't had any problems. No. it's not slow. No it's
not huge. No, I haven't gone blind.
BTW what do zip programs zip the best? Text? ... When I zip up this
compacted and unencrypted db it's the size of a small fly.
The only minor problem is that we have to requery the pulldown after we
add a new account. This happens every seven years or so, whether we
like it or not, so we have to deal with this efficiently. And I have a
requery (everything) button on the pop-up menu for the form coz I want
to view some totals. So it happens as part of that, pretty seamlessly.

There are exceptions to many rules. I have an application with a
calculation that takes about 30 minutes of churning (today ... ten
years ago it was an over-nighter). It has to be done once a year and
then it's etched in stone by company policy. Its results may not be
changed. Do you think I follow the dictum of "Don't store calculated
results?" No I run it once and save the results to a table, and a
gazillion departments use the table for reports. Do we have a special
menu item to recalculate? Yes! Have we ever used it? Yes, but I can't
remember if it was in 1994 or 1995. Seems a piece of land we thought
was in the region was actually in another region so we got special
dispensation to do the thing again.

Mar 18 '06 #4

"John Welch" <john(remove)we lch@cal(remove) central.com> wrote in message
news:dv******** @enews2.newsguy .com...
Hi all. I'm creating a FE/BE database that will be used by about 6 users.
As usual, I have several fields, such as "OrganizationTy peID" that will
get values (via combo boxes in forms) from separate lookup tables. I know
the 'correct' way to do this, using a long integer as the field type. In
this case, however, I am considering doing it "incorrectl y", by actually
storing the text in my field rather than an ID, still using a lookup
table, but joining on the text and using cascading updates. I'm
considering this because the users are going to want to create their own
queries and reports, and it might be less confusing for them if they don't
have to join to the lookup tables all the time. It seems to me that the
main disadvantages will be the extra storage requirements (1 byte per
character vs. 4 bytes per long int) and the speed of data transfer. I
think I can deal with integrity issues with the cascading updates, but I
haven't tried this before.

I'm asking to see if any experienced developers have done this same thing
with ok results, or if anyone has ideas against it that I haven't thought
of.
(I'm a pretty experienced Access developer)

thanks
-John

Yes, I do this sometimes in a couple of situations. Firstly, when the
lookup table is small and simple, e.g.
tblSize="Small" , "Medium", "Large"
tblColour="Red" , "White", "Blue"

I mean would I really create an extra table and write:

SELECT PrdID, PrdName, ColName
FROM tblProduct INNER JOIN tblColour
ON tblProduct.PrdC olour = tblColour.ColID
WHERE tblColour.ColNa me="red"

where I could write:

SELECT PrdID, PrdName, PrdColour
FROM tblProduct WHERE PrdColour="red"
The other time I do this is a bit nerdier, and is similar to Lyle's
comments. I sometimes have large transaction tables which relate to
products. Instead of having a simple ProductID in the table, I have a text
field such as "RM042" which tells me the product is "red", "medium",
region=0 and size=42. This allows me to query the table directly asking
questions like "how many large, blue shirts have I sold recently?" by
searching for "LB???"

Mar 18 '06 #5

"John Welch" <john(remove)we lch@cal(remove) central.com> wrote in message
news:dv******** @enews2.newsguy .com...
Hi all. I'm creating a FE/BE database that will be used by about 6 users.
As usual, I have several fields, such as "OrganizationTy peID" that will
get values (via combo boxes in forms) from separate lookup tables. I know
the 'correct' way to do this, using a long integer as the field type. In
this case, however, I am considering doing it "incorrectl y", by actually
storing the text in my field rather than an ID, still using a lookup
table, but joining on the text and using cascading updates. I'm
considering this because the users are going to want to create their own
queries and reports, and it might be less confusing for them if they don't
have to join to the lookup tables all the time. It seems to me that the
main disadvantages will be the extra storage requirements (1 byte per
character vs. 4 bytes per long int) and the speed of data transfer. I
think I can deal with integrity issues with the cascading updates, but I
haven't tried this before.

I'm asking to see if any experienced developers have done this same thing
with ok results, or if anyone has ideas against it that I haven't thought
of.
(I'm a pretty experienced Access developer)

thanks
-John

Yes, I do this sometimes in a couple of situations. Firstly, when the
lookup table is small and simple, e.g.
tblSize="Small" , "Medium", "Large"
tblColour="Red" , "White", "Blue"

I mean would I really create an extra table and write:

SELECT PrdID, PrdName, ColName
FROM tblProduct INNER JOIN tblColour
ON tblProduct.PrdC olour = tblColour.ColID
WHERE tblColour.ColNa me="red"

where I could write:

SELECT PrdID, PrdName, PrdColour
FROM tblProduct WHERE PrdColour="red"
The other time I do this is a bit nerdier, and is similar to Lyle's
comments. I sometimes have large transaction tables which relate to
products. Instead of having a simple ProductID in the table, I have a text
field such as "RM042" which tells me the product is "red", "medium",
region=0 and size=42. This allows me to query the table directly asking
questions like "how many large, blue shirts have I sold recently?" by
searching for "LB???"
Mar 18 '06 #6
Thanks Lyle. That helps.
Have you ever used a lookup table to store the allowed text values, with
cascading updates in case they ever want to change a spelling or something?
-John
"Lyle Fairfield" <ly***********@ aim.com> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. .
Yep! Example ... the account for a transaction. There are only a dozen
accounts or so, and thousands of transactions. But the account name is
stored in the transaction table, not the ID of some account from an
Accounts table. The Transactions form still has a pulldown for
accounts, it just references the Transactions table itself, "SELECT
DISTINCT Account From Transactions ORDER BY Account". Actually I do
something similar for details except its WHERE COUNT whatever over the
last three months > 2.
I'd like to tell you of all the problems I have had with this over the
past ten years or so because I'm a strong relational db kinda guy. But
I can't because I haven't had any problems. No. it's not slow. No it's
not huge. No, I haven't gone blind.
BTW what do zip programs zip the best? Text? ... When I zip up this
compacted and unencrypted db it's the size of a small fly.
The only minor problem is that we have to requery the pulldown after we
add a new account. This happens every seven years or so, whether we
like it or not, so we have to deal with this efficiently. And I have a
requery (everything) button on the pop-up menu for the form coz I want
to view some totals. So it happens as part of that, pretty seamlessly.

There are exceptions to many rules. I have an application with a
calculation that takes about 30 minutes of churning (today ... ten
years ago it was an over-nighter). It has to be done once a year and
then it's etched in stone by company policy. Its results may not be
changed. Do you think I follow the dictum of "Don't store calculated
results?" No I run it once and save the results to a table, and a
gazillion departments use the table for reports. Do we have a special
menu item to recalculate? Yes! Have we ever used it? Yes, but I can't
remember if it was in 1994 or 1995. Seems a piece of land we thought
was in the region was actually in another region so we got special
dispensation to do the thing again.

Mar 18 '06 #7

"John Welch" <john(remove)we lch@cal(remove) central.com> wrote in message
news:dv******** @enews2.newsguy .com...
Hi all. I'm creating a FE/BE database that will be used by about 6 users.
As usual, I have several fields, such as "OrganizationTy peID" that will
get values (via combo boxes in forms) from separate lookup tables. I know
the 'correct' way to do this, using a long integer as the field type. In
this case, however, I am considering doing it "incorrectl y", by actually
storing the text in my field rather than an ID, still using a lookup
table, but joining on the text and using cascading updates. I'm
considering this because the users are going to want to create their own
queries and reports, and it might be less confusing for them if they don't
have to join to the lookup tables all the time. It seems to me that the
main disadvantages will be the extra storage requirements (1 byte per
character vs. 4 bytes per long int) and the speed of data transfer. I
think I can deal with integrity issues with the cascading updates, but I
haven't tried this before.

I'm asking to see if any experienced developers have done this same thing
with ok results, or if anyone has ideas against it that I haven't thought
of.
(I'm a pretty experienced Access developer)

thanks
-John

<re-post as still not appeared on my news server>

Yes, I do this sometimes in a couple of situations. Firstly, when the
lookup table is small and simple, e.g.
tblSize="Small" , "Medium", "Large"
tblColour="Red" , "White", "Blue"

I mean would I really create an extra table and write:

SELECT PrdID, PrdName, ColName
FROM tblProduct INNER JOIN tblColour
ON tblProduct.PrdC olour = tblColour.ColID
WHERE tblColour.ColNa me="red"

where I could write:

SELECT PrdID, PrdName, PrdColour
FROM tblProduct WHERE PrdColour="red"
The other time I do this is a bit nerdier, and is similar to Lyle's
comments. I sometimes have large transaction tables which relate to
products. Instead of having a simple ProductID in the table, I have a text
field such as "RM042" which tells me the product is "red", "medium",
region=0 and size=42. This allows me to query the table directly asking
questions like "how many large, blue shirts have I sold recently?" by
searching for "LB???"
Mar 18 '06 #8
Nope. I just update
eg Before Income Tax Season I run:
UPDATE Transactions SET Account = 'Charity Donation' WHERE Account =
'Beer'

Mar 18 '06 #9
On Fri, 17 Mar 2006 15:10:38 -0800, "John Welch" <john(remove)we lch@cal(remove) central.com> wrote:
Hi all. I'm creating a FE/BE database that will be used by about 6 users. As
usual, I have several fields, such as "OrganizationTy peID" that will get
values (via combo boxes in forms) from separate lookup tables. I know the
'correct' way to do this, using a long integer as the field type. In this
case, however, I am considering doing it "incorrectl y", by actually storing
the text in my field rather than an ID, still using a lookup table, but
joining on the text and using cascading updates. I'm considering this
because the users are going to want to create their own queries and reports,
and it might be less confusing for them if they don't have to join to the
lookup tables all the time. It seems to me that the main disadvantages will
be the extra storage requirements (1 byte per character vs. 4 bytes per long
int) and the speed of data transfer. I think I can deal with integrity
issues with the cascading updates, but I haven't tried this before.

I'm asking to see if any experienced developers have done this same thing
with ok results, or if anyone has ideas against it that I haven't thought
of.
(I'm a pretty experienced Access developer)

thanks
-John

This is reminisent of the debate about natural versus artificial keys, where minds never meet.
I'd say go ahead as Lyle suggests.
Another advantage is that if your database gets screwed up you stand much more chance of recovering
the data, though this advantage is not nowadays very often needed.
Efficiency phooey, ten or more years ago people said that if you need efficiency don't use a
relational db. Maybe they are still right!
Mar 18 '06 #10

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

Similar topics

3
3064
by: Mark | last post by:
I have a website with an increasing amount of articles and news reports and so I am thinking of moving away from storing each article as a seperate page to having a single page and storing articles in a databasewhich are retrieved using a GET parameter. I see the advantage to me in using this approach as being making use of MySQL's fulltext search capability and less work needed when updating the design of the page. I'm not sure of a few...
7
3643
by: Dave | last post by:
I have a system that basically stores a database within a database (I'm sure lots have you have done this before in some form or another). At the end of the day, I'm storing the actual data generically in a column of type nvarchar(4000), but I want to add support for unlimited text. I want to do this in a smart fashion. Right now I am leaning towards putting 2 nullable Value fields: ValueLong ntext nullable ValueShort nvarchar(4000)...
4
9904
by: Hazzard | last post by:
What is the best way to do this? Binary with 0 representing off and 1 on? Int16 with 1 representing first button, 2 the second, 3 ... varchar with a character values at certain positions in the string representing radio button values. Thanks, -hazz
14
2369
by: Joe | last post by:
Hello All: I am trying to dynamically populate a web page with literal content and controls (textboxes and checkboxes (and eventually two buttons - the buttons do not appear in the code yet). I read an xml file and, using the values retrieved from it, determine what text should be displayed and which controls should be rendered and - most importantly - where those controls should be rendered. The ultimate goal is to have some text...
5
2206
by: hfk0 | last post by:
Hi, I'm new to ASP.net, SQL Server and visual studio.net, and I'm having problem inserting and storing data from a web form to a SQL database. I created a simple ASP.NET web form, a simple SQL database, a database connection (using the SQlDataSource Web Control from the Toolbox), and created the following stored procedure in Visual Studio.Net 2005:
3
2071
by: Adrian Parker | last post by:
v1.1 and v2.0 We have a problem with viewstate not being stored. What's happening is that we create controls in CreateChildControls and add them to a container on the page (whether it be a panel or a table etc). We only set the data values for the controls if not page.ispostback. But, if either of the textboxes change, the page posts back and the changed event fires twice. Protected Overrides Sub CreateChildControls() Dim...
23
1995
by: shank | last post by:
I have the below code found on an ASP site. <% arrName = Split(Request("TextArea"),",") %> <% For i = LBound(arrName) To UBound(arrName) Response.Write "ID: " & arrName(i) & "<br>" Next %>
2
3075
by: Rick | last post by:
Let me start by saying that I know very little about JavaScript. The software that I use to convert my FrameMaker files to HTML uses a JavaScript to hide certain text. The user has to click the paragraph to display that text. Currently, that collapsed text prints only if I go ahead and expand it on my HTML page. I want to be able to have that text automatically print, regardless of whether the user has expanded it on the HTML page.
6
5857
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList ID="FldType_add" Runat="server" DataSource='< %#GetFieldType()%>' DataValueField="Type" DataTextField="Type" /> Oce the page is loaded all the values are added to the dropdown list. But when I thought of getting the selected value from the...
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.