Identifiers

An identifier usually is the name of an object; databases, tables, fields, queries, forms, and reports are objects in Access. Each object has a name that uniquely identifies that object. Sometimes, to identify a subobject, an identifier name consists of a family name (object class) separated from a given name (object name) by a bang symbol or a period (an identifier operator). The family name of the identifier comes first, followed by the separator and then the given name. SQL uses the period as an object separator. An example of an identifier in an SQL statement is as follows:

 Customers.Address 

In this example, the identifier for the Address field object is contained in the Customers table object. Customers is the family name of the object (the table), and Address is the given name of the subobject (the field). In VBA, however, you use the . symbol to separate table names and field names. (The period separates objects and their properties.) If an identifier contains a space or other punctuation, enclose the identifier within square brackets, as in this example:

 [Order Details].Quantity 

You can't include periods or exclamation points within the names of identifiers; [Unit.Price], for example, isn't allowed.

In simple queries that use only one table, you can omit the TableName. prefix. You use identifiers to return the values of fields in form and report objects. Chapters 14 through 18 cover the specific method of identifying objects within forms and reports.

T-SQL

T-SQL uses the period to separate table and field names, but adds an ownername prefix (usually dbo for database owner) to the table name, as in dbo.Customers.Address. SQL Server 7.0+ also encloses table names having spaces or other SQL-illegal punctuation with square brackets [ ].



Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net