Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Names (easy question) 2

Status
Not open for further replies.

SilentAiche

Technical User
Dec 21, 2004
1,325
US
Hi All:

Curiousity question, more than anything.

When I started using Access around 1996, I don't recall any instructor or manual advising that tables should be named tblEmployees or tblContacts, etc., or that any of the other current prefixes be used.

I named things like "R: Status Report" and "Q: For Status Report" and never had any trouble (some of you are probably having a fit at seeing the spaces and colons, but I didn't know any better). Of course, I wasn't doing anything too fancy and nothing with VBA.

My point is that I find object names with these prefixes to be really annoying to read. It's a hell of a lot easier to read Employees than tblEmployees in my opinion.

Can someone explain the benefit or necessity of the prefixes? I couldn't find anything about this in Help. Your time is appreciated.

THanks,
Tim
 
The Reddick (or Hungarian) naming convention is widely used (tbl, frm, qry, rpt, etc.) and is the standard. Therefore, if you are going to use one, then I would suggest you use this one. Since most programmers use it, it will make it easier to understand what you're doing for the person who has to take your place. And once you start using it, it's harder to look at code that does not follow the convention. And you decide how far you want to go with naming objects. They are only guidelines.

Using some kind of convention makes it easier to know what an object is rather than having to stop reading the code to go look it up. For example, strName tells me it's a string variable. gstrName tells me it's a global (public) string variable, and do on.

And if you're trying to choose something from wizards, tables and queries often show up in the same list. So if you see Employee in the list, is it a table or query. However, if you see tblEmployee and qryEmployee you know which is which.
 
I would like to emphasize FancyPrairie's last comment. I have had the experience of having to help people with databases that they have set up. If you have to troubleshoot a form or report and you have a table and query with the same name it is very difficult to tell which of the two items is the record source of the form or report. Thus causing unneccessary problems.

But from the original post it looks like you have a way of identifying it but if you ever had to take the db further - say programming a web interface etc, you may find that your naming conventions using spaces and special characters may cause you grief, because not all languages will deal with those things.

Hope this provides some food for thought

Crystal
--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
To FancyPrairie and Crystalized: Thanks, and a Star to you both! I've long wondered about the naming conventions, and I thought my solution was sufficient. Given the wide world of talent out there (and the fact that none of us is irreplaceable), I thought my naming convention was okay.

Your information was very helpful. I just need to get over my "annoyances."

THanks,
Tim

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top