Object Naming Conventions

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.
 
R

Rick Brandt

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.
 
A

Allen Browne

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.)
 
B

Brian Carlson

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.
 
R

Rick Brandt

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.
 
G

Gina Whipp

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top