This article needs additional citations for verification . (October 2020) (Learn how and when to remove this template message) |
The Leszynski naming convention (or LNC) is a variant of Hungarian notation popularized by consultant Stan Leszynski specifically for use with Microsoft Access development. [1] Although the naming convention is nowadays often used within the Microsoft Access community, and is the standard in Visual Basic programming, it is not widely used elsewhere.
The conventions are derived from an earlier set of conventions, the Leszynski/Reddick naming conventions, originally developed in 1992 by Greg Reddick. Eventually, Leszynski and Reddick had different ideas about how the conventions should be developed, and split into two separate sets of conventions, the other being the RVBA Conventions.
As in all Hungarian notations, it uses prefixes (called tags) to indicate the type of objects and database development fields. The general structure of Hungarian notation (named after Charles Simonyi's native country) is to break down object names into the following elements: [prefix(es)][tag]BaseName[Suffix/Qualifier] The tags are lower case and the object name is camel case. Spaces and underscores are not used.
Since the Leszynski naming convention is a special form of Hungarian notation the same general advantages also apply to the Leszynski convention.
The use of distinctive prefixes makes your database self-documenting; when you see frmSales in VBA code, you will know that it references a form, and when you see curSales you will know that it is a Currency variable. When selecting a query from a drop-down list, you will know that a query starting with qmak is a make-table query, while one starting with quni is a union query. This information will allow you to avoid errors such as using the SetFocus method (a control method) with a field, or trying to open a table.
The elements of the naming convention are described in the following table.
Component | Description | Example |
---|---|---|
Prefix(es) | A lowercase letter that adds extra information to the tag | p for Public variable |
Tag | A three-letter sequence indicating the object type | tbl for table |
BaseName | A word or two describing the object. If several words are used, each starts with a capital letter, and there are no spaces between them | OutlookContacts – contacts imported from Outlook |
Suffix (RVBA), Qualifier (LNC) | A word giving more specific information about an object | ByDate – the data is sorted by date |
Object | Tag |
---|---|
Incomplete objects, backup objects, or objects that are under development | _ or – (In some versions of Access, dashes sort to the beginning of the database object list.) |
Hidden system objects | zh |
Displayed system objects | zs |
Programmatically created temporary objects | zt |
Backup copies of objects, for later copying or reuse | zz |
Variable Type | Tag |
---|---|
Local variable | [no prefix] |
Local static variable | s |
Module-level variable | m |
Public variable in a form or report module | p |
Public variable declared in the Declarations section of a standard module | g |
Object | Tag |
---|---|
Class module | cls |
Form | frm |
Form (dialog) | fdlg |
Form (menu) | fmnu |
Form (message) | fmsg |
Form (subform) | fsub |
Macro | mcr |
Module | bas |
Module | mod |
Query (any type) | qry |
Query (append) | qapp |
Query (crosstab) | qxtb |
Query (data definition) | qddl |
Query (delete) | qdel |
Query (form filter) | qflt |
Query (lookup) | qlkp |
Query (make-table) | qmak |
Query (select) | qry (or qsel) |
Query (SQL pass-through) | qspt |
Query (union) | quni |
Query (update) | qupd |
Report | rpt |
Report (subreport) | rsub |
Table | tbl |
Middle Table | trel |
Table (attached dBASE) | tdbf |
Table (attached Excel) | txls |
Table (attached FoxPro) | tfox |
Table (attached Lotus) | twks |
Table (attached ODBC) | todb |
Table (attached Paradox) | tpdx |
Table (attached SQL Server) | tsql |
Table (attached text) | ttxt |
Table (lookup) | tlkp |
Pages | pge |
Object | Tag |
---|---|
Autonumber (random non-sequential) | idn |
Autonumber (replication ID) | idr |
Autonumber (sequential) | ids |
Binary | bin |
Byte | byt |
Currency | cur |
Date/Time | dtm |
Double | dbl |
Hyperlink | hlk |
Integer | int |
Long | lng |
Memo | mem |
OLE | ole |
Single | sng |
Text (character) | chr |
Yes/No (Boolean) | ysn |
Object | Tag |
---|---|
Boolean | bln |
CommandBar | cbr |
Control (generic; useful when cycling through controls on a form or report) | ctl |
Currency | cur |
Database | dbs |
Double | dbl |
Form | frm |
Integer | int |
Long | lng |
QueryDef | qdf |
Report | rpt |
Single | sng |
Snapshot | snp |
String | str |
Table | tbl |
Type (user-defined) | typ |
Variant | var |
Object | Tag |
---|---|
Attachment | att |
Bound object frame | frb |
Chart (graph) | cht |
Check box | chk |
Combo box | cbo |
Command button | cmd |
Custom control | ocx |
Frame | fra |
Hyperlink | hlk |
Image | img |
Label | lbl |
Line | lin |
List box | lst |
Option button (Radio Button) | opt |
Option group | grp |
Page (on a Tab control) | pge |
Page break | brk |
Rectangle (shape) | shp |
Subform/report | sub |
Tab control | tab |
Text box | txt |
Toggle button | tgl |
Button | btn |
Unbound object frame | fru |
Object/variable name | LNC naming elements | Description |
---|---|---|
tblEmployees | tag + base name | A table of employee data |
qupdSales | tag + base name | A query that updates sales data |
fsubDayMax | tag + base name + qualifier | A subform that shows the maximum day |
intLines | tag + base name | An Integer variable to hold a value representing the number of lines in a Word table |
curSales | tag + base name | A Currency variable holding a Sales value |
pstrForm | prefix + tag + base name | A public String variable holding a form name |
zztblContacts | prefix + tag + base name | A backup Contacts table, for copying and filling with imported data |
Camel case is the practice of writing phrases without spaces or punctuation, indicating the separation of words with a single capitalized letter, and the first word starting with either case. Common examples include "iPhone", "JavaScript", and "eBay". It is also sometimes used in online usernames such as "johnSmith", and to make multi-word domain names more legible, for example in advertisements.
A database is an organized collection of data, generally stored and accessed electronically from a computer system. Where databases are more complex they are often developed using formal design and modeling techniques.
Eiffel is an object-oriented programming language designed by Bertrand Meyer and Eiffel Software. Meyer conceived the language in 1985 with the goal of increasing the reliability of commercial software development; the first version becoming available in 1986. In 2005, Eiffel became an ISO-standardized language.
Microsoft Access is a database management system (DBMS) from Microsoft that combines the relational Microsoft Jet Database Engine with a graphical user interface and software-development tools. It is a member of the Microsoft Office suite of applications, included in the Professional and higher editions or sold separately. It is also a member of the Microsoft 365 suite. Latest versions have more protections. A trial version of the software is available.
A relational database is a digital database based on the relational model of data, as proposed by E. F. Codd in 1970. A software system used to maintain relational databases is a relational database management system (RDBMS). Many relational database systems have an option of using the SQL for querying and maintaining the database.
SQL is a domain-specific language used in programming and designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS). It is particularly useful in handling structured data, i.e. data incorporating relations among entities and variables.
Hungarian notation is an identifier naming convention in computer programming, in which the name of a variable or function indicates its intention or kind, and in some dialects its type. The original Hungarian Notation uses intention or kind in its naming convention and is sometimes called Apps Hungarian as it became popular in the Microsoft Apps division in the development of Word, Excel and other apps. As the Microsoft Windows division adopted the naming convention, they used the actual data type for naming, and this convention became widely spread through the Windows API; this is sometimes called Systems Hungarian notation.
An object–relational database (ORD), or object–relational database management system (ORDBMS), is a database management system (DBMS) similar to a relational database, but with an object-oriented database model: objects, classes and inheritance are directly supported in database schemas and in the query language. In addition, just as with pure relational systems, it supports extension of the data model with custom data types and methods.
In database systems, isolation determines how transaction integrity is visible to other users and systems. For example, when a user is creating a purchase order and has created the header, but not the purchase order lines, is the header available for other systems or users to see?
Data modeling in software engineering is the process of creating a data model for an information system by applying certain formal techniques.
A query plan is a sequence of steps used to access data in a SQL relational database management system. This is a specific case of the relational model concept of access plans.
A user-defined function (UDF) is a function provided by the user of a program or environment, in a context where the usual assumption is that functions are built into the program or environment.
In computer programming, a naming convention is a set of rules for choosing the character sequence to be used for identifiers which denote variables, types, functions, and other entities in source code and documentation.
The object–relational impedance mismatch is a set of conceptual and technical difficulties that are often encountered when a relational database management system (RDBMS) is being served by an application program written in an object-oriented programming language or style, particularly because objects or class definitions must be mapped to database tables defined by a relational schema.
In computer science, a database cursor is a control structure that enables traversal over the records in a database. Cursors facilitate subsequent processing in conjunction with the traversal, such as retrieval, addition and removal of database records. The database cursor characteristic of traversal makes cursors akin to the programming language concept of iterator.
Borland Database Engine (BDE) is the Windows-based core database engine and connectivity software behind Borland Delphi, C++Builder, IntraBuilder, Paradox for Windows, and Visual dBASE for Windows.
Entity–attribute–value model (EAV) is a data model to encode, in a space-efficient manner, entities where the number of attributes that can be used to describe them is potentially vast, but the number that will actually apply to a given entity is relatively modest. Such entities correspond to the mathematical notion of a sparse matrix.
Semi-structured data is a form of structured data that does not obey the tabular structure of data models associated with relational databases or other forms of data tables, but nonetheless contains tags or other markers to separate semantic elements and enforce hierarchies of records and fields within the data. Therefore, it is also known as self-describing structure.
Apache Empire-db is a Java library that provides a high level object-oriented API for accessing relational database management systems (RDBMS) through JDBC. Apache Empire-db is open source and provided under the Apache License 2.0 from the Apache Software Foundation.
PL/SQL is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database, Times Ten in-memory database, and IBM DB 2. Oracle Corporation usually extends PL/SQL functionality with each successive release of the Oracle Database.
Part of this article is based on Helen Feddema's book, Expert One-on-One Microsoft Access Application Development, Wiley, ISBN 0-7645-5904-4.