「保留字」是對 Microsoft Access 有特殊意義的字與符號。 如果您使用保留字或符號為桌面資料庫或 Web 應用程式表格中的欄位命名,Access 會警告您該字已保留,且當您參照該欄位時可能會遇到錯誤。
如果使用保留字為控制項、物件或變數命名,也可能會遇到錯誤。 您收到的錯誤訊息不一定會告訴您問題的原因是保留字。 因此,可能難以確定應該變更的是什麼。 例如,Access 可能顯示類似以下的訊息:
精靈無法預覽您的報表,可能是因為報表所需的表格被獨佔鎖定。
如果保留字已在使用中,可以在該字出現的每個地方括上方括號 ([ ]) 以避免錯誤訊息。 不過,最好的解決方案是將名稱改為未保留的字。
附註: 提供所有保留字的清單不太務實,例如內建函數名稱或使用者定義名稱。 如果您設定指向類型程式庫、物件程式庫或 ActiveX 控制項的參照,該程式庫的保留字也會是您資料庫中的保留字。
本文內容
Access 保留字
-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
Access 保留符號
下列符號不得用來當做欄位名稱的一部分或物件名稱的一部分:
. / * ; : ! # & - ? " ' $ % |
Access 資料庫引擎保留字
Access 資料庫引擎會以不同模式執行,取決於呼叫它的是 Access、資料存取物件、Access 資料庫引擎的 Microsoft OLE 提供者或 Microsoft Access ODBC 驅動程式。 它可以 ANSI 模式或非 ANSI (傳統) 模式執行。
由於使用這兩個模式會產生兩組稍微不同的保留字,因此使用保留字的的查詢可能會在其中一個模式成功,卻在另一個模式中失敗。
下列為選擇識別碼名稱時應避免的保留字清單。
-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