Tuesday, February 19, 2019

Learn about Access reserved words and symbols

Learn about Access reserved words and symbols

"Reserved words" are words and symbols that have a specific meaning to Microsoft Access. If you use a reserved word or symbol to name a field in a desktop database or web app table, Access warns you that the word is reserved and that you might encounter errors when referring to the field.

You might also encounter errors if you use a reserved word to name a control, an object, or a variable. The error messages you receive don't necessarily tell you that a reserved word is the cause of the problem. As a result, it can be difficult to identify what needs to be changed. For example, Access might display a message similar to the following:

The wizard was unable to preview your report, possibly because a table needed by your report is exclusively locked.

If a reserved word is already in use, you can avoid error messages by surrounding each occurrence of the word with brackets ([ ]). However, the best solution is to change the name to a nonreserved word.

Note:  It is not practical to provide a list of all reserved words, such as built-in function names or user-defined names. If you set a reference to a type library, an object library, or an ActiveX control, that library's reserved words are also reserved words in your database.

In this article

Access reserved words

Access reserved symbols

Access database engine reserved words

Access reserved words

-A

ADD

ALL

Alphanumeric

ALTER

AND

ANY

Application

AS

ASC

Assistant

AUTOINCREMENT

Avg

-B

BETWEEN

BINARY

BIT

BOOLEAN

BY

BYTE

-C

CHAR, CHARACTER

COLUMN

CompactDatabase

CONSTRAINT

Container

Count

COUNTER

CREATE

CreateDatabase

CreateField

CreateGroup

CreateIndex

CreateObject

CreateProperty

CreateRelation

CreateTableDef

CreateUser

CreateWorkspace

CURRENCY

CurrentUser

-D

DATABASE

DATE

DATETIME

DELETE

DESC

Description

DISALLOW

DISTINCT

DISTINCTROW

Document

DOUBLE

DROP

-E

Echo

Else

End

Eqv

Error

EXISTS

Exit

-F

FALSE

Field, Fields

FillCache

FLOAT, FLOAT4, FLOAT8

FOREIGN

Form, Forms

FROM

Full

FUNCTION

-G

GENERAL

GetObject

GetOption

GotoPage

GROUP

GROUP BY

GUID

-H

HAVING

-I

Idle

IEEEDOUBLE, IEEESINGLE

If

IGNORE

Imp

IN

INDEX

Index, Indexes

INNER

INSERT

InsertText

INT, INTEGER, INTEGER1, INTEGER2, INTEGER4

INTO

IS

-J

JOIN

-K

KEY

-L

LastModified

LEFT

Level

Like

LOGICAL, LOGICAL1

LONG, LONGBINARY, LONGTEXT

-M

Macro

Match

Max, Min, Mod

MEMO

Module

MONEY

Move

-N

NAME

NewPassword

NO

Not

Note

NULL

NUMBER, NUMERIC

-O

Object

OLEOBJECT

OFF

ON

OpenRecordset

OPTION

OR

ORDER

Orientation

Outer

OWNERACCESS

-P

Parameter

PARAMETERS

Partial

PERCENT

PIVOT

PRIMARY

PROCEDURE

Property

-Q

Queries

Query

Quit

-R

REAL

Recalc

Recordset

REFERENCES

Refresh

RefreshLink

RegisterDatabase

Relation

Repaint

RepairDatabase

Report

Reports

Requery

RIGHT

-S

SCREEN

SECTION

SELECT

SET

SetFocus

SetOption

SHORT

SINGLE

SMALLINT

SOME

SQL

StDev, StDevP

STRING

Sum

-T

TABLE

TableDef, TableDefs

TableID

TEXT

TIME, TIMESTAMP

TOP

TRANSFORM

TRUE

Type

-U

UNION

UNIQUE

UPDATE

USER

-V

VALUE

VALUES

Var, VarP

VARBINARY, VARCHAR

-W

WHERE

WITH

Workspace

-X

Xor

-Y

Year

YES

YESNO

Top of Page

Access reserved symbols

The following symbols must not be used as part of a field name or as part of an object name:

.

/

*

;

:

!

#

&

-

?

"

'

$

%

Top of Page

Access database engine reserved words

The Access database engine runs in different modes, depending on whether it is called from Access, data access objects, the Microsoft OLE Provider for the Access database engine, or the Microsoft Access ODBC driver. It can be run in either ANSI mode or non-ANSI (traditional) mode.

Because using these two modes results in two slightly different sets of reserved words, a query that uses a reserved word might work in one mode and fail in another mode.

The following is a list of reserved words to avoid when choosing identifier names.

-A

ABSOLUTE

ACTION

ADD

ADMINDB

ALL

ALLOCATE

ALPHANUMERIC

ALTER

AND

ANY

ARE

AS

ASC

ASSERTION

AT

AUTHORIZATION

AUTOINCREMENT

AVG

-B

BAND

BEGIN

BETWEEN

BINARY

BIT

BIT_LENGTH

BNOT

BOR

BOTH

BXOR

BY

BYTE

-C

CASCADE

CASCADED

CASE

CAST

CATALOG

CHAR

CHARACTER

CHAR_LENGTH

CHARACTER_LENGTH

CHECK

CLOSE

COALESCE

COLLATE

COLLATION

COLUMN

COMMIT

COMP

COMPRESSION

CONNECT

CONNECTION

CONSTRAINT

CONSTRAINTS

CONTAINER

CONTINUE

CONVERT

CORRESPONDING

COUNT

COUNTER

CREATE

CREATEDB

CROSS

CURRENCY

CURRENT

CURRENT_DATE

CURRENT_TIME

CURRENT_TIMESTAMP

CURRENT_USER

CURSOR

-D

DATABASE

DATE

DATETIME

DAY

DEALLOCATE

DEC

DECIMAL

DECLARE

DEFAULT

DEFERRABLE

DEFERRED

DELETE

DESC

DESCRIBE

DESCRIPTOR

DIAGNOSTICS

DISALLOW

DISCONNECT

DISTINCT

DOMAIN

DOUBLE

DROP

-E

ELSE

END

END-EXEC

ESCAPE

EXCEPT

EXCEPTION

EXCLUSIVECONNECT

EXEC

EXECUTE

EXISTS

EXTERNAL

EXTRACT

-F

FALSE

FETCH

FIRST

FLOAT

FLOAT4

FLOAT8

FOR

FOREIGN

FOUND

FROM

FULL

-G

GENERAL

GET

GLOBAL

GO

GOTO

GRANT

GROUP

GUID

-H

HAVING

HOUR

-I

IDENTITY

IEEEDOUBLE

IEEESINGLE

IGNORE

IMAGE

IMMEDIATE

ININDEX

INDICATOR

INHERITABLE

INITIALLY

INNER

INPUT

INSENSITIVE

INSERT

INT

INTEGER

INTEGER1

INTEGER2

INTEGER4

INTERSECT

INTERVAL

INTO

IS

ISOLATION

-J

JOIN

-K

KEY

-L

LANGUAGE

LAST

LEADING

LEFT

LEVEL

LIKE

LOCAL

LOGICAL

LOGICAL1

LONG

LONGBINARY

LONGCHAR

LONGTEXT

LOWER

-M

MATCH

MAX

MEMO

MIN

MINUTE

MODULE

MONEY

MONTH

-N

NAMES

NATIONAL

NATURAL

NCHAR

NEXT

NO

NOT

NOTE

NULL

NULLIF

NUMBER

NUMERIC

-O

OBJECT

OCTET_LENGTH

OFOLEOBJECT

ONONLY

OPEN

OPTION

ORORDER

OUTER

OUTPUT

OVERLAPS

OWNERACCESS

-P

PAD

PARAMETERS

PARTIAL

PASSWORD

PERCENT

PIVOT

POSITION

PRECISION

PREPARE

PRESERVE

PRIMARY

PRIOR

PRIVILEGES

PROC

PROCEDURE

PUBLIC

-Q

-R

READ

REAL

REFERENCES

RELATIVE

RESTRICT

REVOKE

RIGHT

ROLLBACK

ROWS

-S

SCHEMA

SCROLL

SECOND

SECTION

SELECT

SELECTSCHEMA

SELECTSECURITY

SESSION

SESSION_USER

SET

SHORT

SINGLE

SIZE

SMALLINT

SOME

SPACE

SQL

SQLCODE

SQLERROR

SQLSTATE

STRING

SUBSTRING

SUM

SYSTEM_USER

-T

TABLE

TABLEID

TEMPORARY

TEXT

THEN

TIME

TIMESTAMP

TIMEZONE_HOUR

TIMEZONE_MINUTE

TO

TOP

TRAILING

TRANSACTION

TRANSFORM

TRANSLATE

TRANSLATION

TRIM

TRUE

-U

UNION

UNIQUE

UNIQUEIDENTIFIER

UNKNOWN

UPDATE

UPDATEIDENTITY

UPDATEOWNER

UPDATESECURITY

UPPER

USAGE

USER

USING

-V

VALUE

VALUES

VARBINARY

VARCHAR

VARYING

VIEW

-W

WHEN

WHENEVER

WHERE

WITH

WORK

WRITE

-X

-Y

YEAR

YESNO

-Z

ZONE

Top of Page

No comments:

Post a Comment