Microsoft Support Number OR Call Toll-Free @ 1-844-478-2887

Tuesday, September 6, 2011

Naming Conventions for Microsoft Access

Software development in Microsoft Access is relatively simple and almost anyone can do it but if you want to be taken seriously by professional database developers then there are some mandatory rules that you must follow whilst developing your database. One of the first aspects professional developers will look at when reviewing your work will be the naming standards you are using for your Microsoft Access Objects. Microsoft Access allows you to use, what is considered in the professional database development world, poor naming standards. For example in your field names, you can have spaces however in the professional world that is a major no no.

One of the reasons we don't use spaces in Microsoft Access is that when you start creating complex queries and functions that refer to fields, if you have spaces in the field names it is possible to put two spaces into the field name but it only appears that there one space. What this means is that your query won't work and can sometimes take many days to find the mistake. The key issue is that you must never use spaces in your field names, database names or any of the seven different object types. There are in fact two ways that you should be naming your fields, database names and so on.

Naming Fields

Let us say for instance you wanted to create a field to store the Postcodes for the suburbs your customers live in. We could write this field in two ways, the first thing you must do for fields is to add the prefix fld at the start of the field. Then add the field name as required -

fldPostcode or fldPost_code

Either technique is quite acceptable. If you were developing a field for Post Codes, that is codes on posts, then the recommended way for writing the field name would be -

fldPostCode or fldPost_Code

You will notice that in the second example the second word is in capitals rather than in lower case. The use of capital letters signifies that each word represents a separate aspect of the field, so in this case the code in capitals means you are referring to codes on posts. The same naming principles apply to database names, and each of the seven Microsoft Access object types.

Naming Tables

When naming tables, there are three prefixes that you can use. The first prefix tbl is used for the core tables you will be storing your good data in. The tmp prefix is used for tables that will be storing temporary data. It is also recommended that you import your data into a temporary table before inserting the data into your good data tables. We do this for two core reasons; the first is that testing your data in a temporary table is much easier than doing it on the fly while you are trying to import your data.

The third table prefix I recommend being used is bck for backup tables. The key advantage of using these prefix's on your tables is that Microsoft Access will automatically group them by the prefix, which means you will keep all your good tables together, your temporary tables together and your backup tables together.

Read more:

No comments: