设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 3072|回复: 6
打印 上一主题 下一主题

Naming Conventions

[复制链接]
跳转到指定楼层
1#
发表于 2005-8-5 22:40:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
标题:Naming Conventions

文章来源:http://www.csun.edu/itr/guides/access/2000/beg03.html



Naming ConventionsDatabase development includes naming object files consistently. You do this by using the assigned naming conventions for each object within Microsoft Access 2000. Naming conventions are not mandatory, but they do make your work consistent. If you plan on sharing a database with others, then it is a particularly good idea to use them.

The Leszynski Naming Convention

Object Naming Conventions

The Leszynski Naming ConventionThe naming convention used in this document is called the Leszynski Naming Convention (or LNC). Originally suggested by Stan Leszynski and Greg Reddick in a white paper entitled "The Leszinskieddick Guidelines for Access 1.x, 2.x" it has become the convention used by Access and Visual Basic developers. This naming convention suggests that you precede object names with three letters. These letters are called "tags" and enable you to open, edit, and troubleshoot without having to decode what is contained within the object itself.





Let's say you have just created a table called "My Table". The LNC way to save that table is to start the filename with the tag "tbl" (see Figure 1, below). Please note, file names can be more than one word, but underscores and spaces should not be utilized and each word within the file name should begin with a capital letter. Since databases are often shared with others, this format allows other users to easily identify the file and it saves you time when you begin to use some of the more advanced features that Access has to offer.

   







FIGURE 1. "Save As" dialog box example.

  As you can see from Figure 1, the file name is preceded by "tbl" for table, and the file name does not contain any spaces or underscores.

Object Naming ConventionsThe same format applies to the other objects within Access, the only thing that changes is the naming convention for the object you are working with. For a listing of the different naming conventions, please refer to table below.   





命名规则







数据库的发展包括一惯地对对象命名。你在ACCESS里对每一个对象命名都应该使用赋值的习惯。命名方法不是完全一致的,可是使用一种好的习惯命名能够使你的工作更加的协调。如果你打算共用一个数据库中的其他一些东西时,你就会发现这种独特的命名能够起到很好的作用。







Leszynski命名规则:







这个命名习惯使用在文档中被叫做Leszynski命名法则。起初这个建议被一个叫Stan Leszynski and Greg Reddick写进一张有资格的白纸里“LeszinskieddickACCESS1.X、ACCESS2.X指导方针”。现在已经被ACCESS和VB开发者变成了一种规则。这个命名规则建议使用文件开头的三个字母。这三个字母叫做标签,它能够引导你打开或编辑窗体。在一些没有解码的代码中包含它自己还可以充当故障检修员。





下面说一下我们已经建立的一个表叫做“我的表格”。用习惯的方式命名保存文件名时取表格的前三个字母“tbl”(如图1,所示)。文件名可以超过一个单词但是不能够用下划线,单词与单词之间不要有空格,开始第一个字母必须大写。以后数据库需要共享时就可以很方便的识别及引用了。当你要进行高级应用的时候也很容易找到相关的资料了。









              图1







当你看弹出上图的对话框时,你就可以为表命名为“tblxx”。并确保文件名不能够有空格及下划线。







对象命名规则:







同样的习惯应用到ACCESS的其他对象里,唯一的不同在于你改变你所操作的对象的不同。下面是各种不同对象的命名清单:















[此贴子已经被作者于2005-8-13 12:23:20编辑过]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2010-1-7 02:24:40 | 只看该作者
谢谢啦!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-2 23:34 , Processed in 0.091035 second(s), 26 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表