adding multiple constraint relationship in Access

I need to add a multiple-constraint relationship between two tables in my app. The DDL for Access says that it should look something like:

ALTER TABLE tbl_name ADD CONSTRAINT multi-field-index

However, I can see no definition of what multi-field-index is. Have I missed something somewhere?

Sean

[321 byte] By [sean_kirkpatrick] at [2007-12-23]
# 1

Hi,

Here's a piece of code on how to use constraints in access:

CREATE TABLE Orders (OrderId INTEGER PRIMARY KEY, CustId INTEGER, OrderNotes NCHAR VARYING (255), CONSTRAINT FKOrdersCustId FOREIGN KEY (CustId) REFERENCES Customers ON UPDATE SET NULL ON DELETE SET NULL

As you can see the value of constraints goes this kind of declaration:

CONSTRAINT name
{PRIMARY KEY (primary1[, primary2 [, ...]]) |
UNIQUE (unique1[, unique2 [, ...]]) |
NOT NULL (notnull1[, notnull2 [, ...]]) |
FOREIGN KEY [NO INDEX] (ref1[, ref2 [, ...]]) REFERENCES foreigntable [(foreignfield1 [, foreignfield2 [, ...]])]
[ON UPDATE CASCADE | SET NULL]
[ON DELETE CASCADE | SET NULL]}

cheers,

Paul June A. Domag

PaulDomag at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2

Hi Paul.

Thanks for this. I was just about to post that I found this very same answer by spending a couple of hours pawing through the Access docs.

I appreciate your help.

Sean

sean_kirkpatrick at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified