Amir said:
What is the difference between primary key and index in Access?
If I define an Index field which is Unique and Not allowed Null, is it a the
same as a PK?
And my two cents:
A Primary Key is the column or combination of columns (Access refers
to them as "fields") that *uniquely* defines a row in a table. No
true table is without a Primary Key, although most relational database
software products allow it.
An Index is a file-feature that is used for various things, like
making lookups more rapid, for enforcing uniqueness in a column, etc.
Access uses indexes to enforce Primary Keys and Foreign Keys (for
"Referential Integrity").
And, a litte more:
A Foreign Key is a column or combination of columns in one table, that
are also found in another table, where Access uses an index to make
sure that no value(s) in the Foreign Key column(s) exists that does
not also exist in those same columns in the "other" table. This
process is called "enforcing Referential Integrity", and is used, for
example, to make sure that a database doesn't have customer phone
numbers hanging around in the PhoneNumbers table with CustomerID
values that don't exist in the Customers table.
Sincerely,
Chris O.