Object Naming Conventions

  • Thread starter Thread starter Brian Carlson
  • Start date Start date
B

Brian Carlson

Do underscores in object names cause any issues? Such as Daily_Report? Any
tips on object naming conventions that seem to work best? Thanks in advance.
 
Do underscores in object names cause any issues? Such as Daily_Report?
Any tips on object naming conventions that seem to work best? Thanks in
advance.

Underscores are fine. I prefer Camel-Case as in "DailyReport" myself,
but underscores are better than spaces or dashes.
 
Underscores are fine for objects in Access.
(You may want to avoid them in class modules.)

There are many styles of naming convention.
A popular one uses 3-char prefixes:
http://www.xoc.net/standards/rvbanc.asp#DAO

Others use different systems, e.g.:
http://www.granite.ab.ca/access/tablefieldnaming.htm
http://www.granite.ab.ca/access/tonysobjectnamingconventions.htm

Some factors to consider:
- In some contexts, it can be hard to know whether a source is a table or
query if you use no naming convention.

- Use A-Z, 0-9, and underscore only, and don't use leading numbers. (This
avoids several issues where you would have to type square brackets around
names.)

- Object names are not case sensitive, but camel case may make it easier to
read. It's up to you whether DailyReport is faster to type than
Daily_Report.

- Consider what additional distinctions you want to make, e.g. a prefix to
distinguish local tables (that exist in the front end) from attached tables
(in the back end.)
 
Thanks for the answer Rick. I am intending on using Camel-Case, but I would
like to make the names as clear as possible such as: table_DailyReport or
tbl_DailyReport, but want to ensure that my naming conventions do not cause
me any issues in the future in case I learn enough to expand my database.
 
Thanks for the answer Rick. I am intending on using Camel-Case, but I
would like to make the names as clear as possible such as:
table_DailyReport or tbl_DailyReport, but want to ensure that my naming
conventions do not cause me any issues in the future in case I learn
enough to expand my database.

I'm not a fan of object-type-prefixing, but many do use it. Bottom line
is if it makes sense to you, then use whatever convention you like.
Consistency is a best practice, but there are no naming convention police
that will come knocking on your door.

As for "causing problems" that is pretty much limited to avoiding certain
characters. I never use anything besides A-Z, 0-9, and the underscore.
While Access and SQL Server allow "sloppy" naming you never know when you
might end up working with another engine or tools that are more strict.
 
While Access and SQL Server allow "sloppy" naming you never know when you
Rick,

Just an observation I made, Access 2007 is a little more intolerant then
it's predecessors when it come to "sloppy" naming.
--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
Back
Top