473,385 Members | 1,930 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,385 software developers and data experts.

Codes and masking

Hi Newsgroup
Does anyone here care to share their thoughts/experiences with using
masking? I am storing categories of books which libraries stock, so that I
might have codes:

015-000-000 = Languages
015-001-000 = European languages
015-001-001 = English
015-001-002 = German
015-001-003 = French
....
etc
This lets me use criteria such as LIKE "015-001-???" when I want to find
libraries which have books on any European language.

Typically, I use non-meaningful autonumber ID columns for a primary key so I
might have:

tblLibraries: LibID, LibName, LibAddress, etc
tblSubjects: SubID, SubName, SubMask
tblLibrarySubjects: LibID, SubID (the junction table)

However, if I simply store the SubID in the junction table, I will always
need to have a query using a join from the subjects table if I need LIKE
"015-001-???". I could use this mask as the primary key in the subjects
table and save myself a join. Another benefit might be that by enforcing
cascade updates, re-classifying a subject would be easier - eg I could
change its place in the hierarchy. What do you think? Also, should the
junction table have its own PK if the 2 primary keys from the other tables
already form a unique index?

Thanks for any thoughts
Nov 13 '05 #1
6 1964
For the lookup table of languages, there is no need to use an AutoNumber,
because this key field uniquely describes the record. A Text primary key is
fine.

I would suggest that you omit the dashes from the key and store only the
numbers, because:
- the dashes are not part of the data, and
- Access 2000 and later handle the dashes inconsistently.
You can use an Input mask to display the field with dashes.

Alternatively, use 3 separte Number fields so the data is atomic and may be
more efficient. A multi-field key works fine, though this might get
cumbersome if you then needed to use it also into further generations of
grandchild relations.

BTW, it's a matter of style, but I often use a 24-char text field as the
primary key for lookup fields such as categories. Not only is the natural
key simpler, but you can leave the bound key visible, which circumvents the
problems associated with filtering the RowSource of combos in continuous
forms.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Stefan Kowalski" <a@b.com> wrote in message
news:ct**********@hercules.btinternet.com...
Hi Newsgroup
Does anyone here care to share their thoughts/experiences with using
masking? I am storing categories of books which libraries stock, so that
I might have codes:

015-000-000 = Languages
015-001-000 = European languages
015-001-001 = English
015-001-002 = German
015-001-003 = French
...
etc
This lets me use criteria such as LIKE "015-001-???" when I want to find
libraries which have books on any European language.

Typically, I use non-meaningful autonumber ID columns for a primary key so
I might have:

tblLibraries: LibID, LibName, LibAddress, etc
tblSubjects: SubID, SubName, SubMask
tblLibrarySubjects: LibID, SubID (the junction table)

However, if I simply store the SubID in the junction table, I will always
need to have a query using a join from the subjects table if I need LIKE
"015-001-???". I could use this mask as the primary key in the subjects
table and save myself a join. Another benefit might be that by enforcing
cascade updates, re-classifying a subject would be easier - eg I could
change its place in the hierarchy. What do you think? Also, should the
junction table have its own PK if the 2 primary keys from the other tables
already form a unique index?

Thanks for any thoughts

Nov 13 '05 #2
Allen Browne wrote:
- Access 2000 and later handle the dashes inconsistently.


Hi Allen...could you elaborate on this? I usually don't care when using
dashes in SocialSecurity number, maybe phone numbers since I am not
worried about diskspace. Besides, both are text fields. But if there
is a problem, I wouldn't want to make my life work harder.
Nov 13 '05 #3
See:
ACC2000: Query Returns no Records with an Indexed Field That Contains
Dashes
at:
http://support.microsoft.com/default...b;en-us;271661

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Salad" <oi*@vinegar.com> wrote in message
news:3D****************@newsread3.news.pas.earthli nk.net...
Allen Browne wrote:
- Access 2000 and later handle the dashes inconsistently.


Hi Allen...could you elaborate on this? I usually don't care when using
dashes in SocialSecurity number, maybe phone numbers since I am not
worried about diskspace. Besides, both are text fields. But if there is
a problem, I wouldn't want to make my life work harder.

Nov 13 '05 #4
Allen Browne wrote:
See:
ACC2000: Query Returns no Records with an Indexed Field That Contains
Dashes
at:
http://support.microsoft.com/default...b;en-us;271661

Thanks. Something to keep in mind.
Nov 13 '05 #5

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
See:
ACC2000: Query Returns no Records with an Indexed Field That Contains
Dashes
at:
http://support.microsoft.com/default...b;en-us;271661

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Salad" <oi*@vinegar.com> wrote in message
news:3D****************@newsread3.news.pas.earthli nk.net...
Allen Browne wrote:
- Access 2000 and later handle the dashes inconsistently.


Hi Allen...could you elaborate on this? I usually don't care when using
dashes in SocialSecurity number, maybe phone numbers since I am not
worried about diskspace. Besides, both are text fields. But if there is
a problem, I wouldn't want to make my life work harder.



Hi Allen
I'm replying under this post because your original answer is not showing via
this newsreader, although I did read it via Google. Just to say thanks and
that I will implement your recommendations.


Nov 13 '05 #6
[posted and mailed]

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in
news:41***********************@per-qv1-newsreader-01.iinet.net.au
:
See:
ACC2000: Query Returns no Records with an Indexed Field
That Contains
Dashes
at:
http://support.microsoft.com/default...d=kb;en-us;271
661


--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #7

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

Similar topics

4
by: Piotr | last post by:
Please help me, I can't solve this problem: I have domain: www.main_domain.com/index.php?userid=23&parametr1=2&parametr2=3 (and other site files like...
2
by: Ginchy | last post by:
I have uploaded a small 3 page web using MS Publisher 2003 and after uploading I switched on url masking to cloak the url. I am certain that it worked fine. I simply changed the colour scheme...
1
by: john sutor | last post by:
Is there a way in C# to add masking (for a date format) to a textbox?
0
by: Dana Epp | last post by:
I have a ToolBarButton that when I set it to disabled (button.Enabled = false;) causes a really ugly gray masking effect to take place. This is normal and the intended way of the button, but I...
1
by: Brian Keating EI9FXB | last post by:
Hello there, Does anyone know how to to Bitmap masking in .NET, In c++ i used, CreateCompatibleDC GetBitmap Then on the bitmap and the bitmap mask i called. {SelectBitmap StretchBlt}
1
by: NBB | last post by:
I can't figure this one out. Here's the situation, should be pretty for the pros in here. I have a ListBox that is populated with the DataTextField and DataValueField flags of the DataSet....
3
by: Hai Nguyen | last post by:
Hi All I have a textbox want to mask as phone box. How can I do it? Thanks
9
by: Daniel Smedegaard Buus | last post by:
Hey all :) I was wondering about the $error_types (I particularly notice the 's' suffix when reading the manual) parameter for 'set_error_handler()': Can be used to mask the triggering of the...
2
by: meghla | last post by:
I can not understand how to implement bit masking on a c code?? while working with array it is taking too much time.................. so i need help. i need some suggestion and sample code of C...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.