Error when using a contraint in Access

Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2008
Posts: 40
Reputation: RenFromPenn is an unknown quantity at this point 
Solved Threads: 0
RenFromPenn RenFromPenn is offline Offline
Light Poster

Error when using a contraint in Access

 
-1
  #1
Sep 22nd, 2009
Hi,

I am trying to complete an example from the book SQL for Microsoft Access. I have typed it into Access just as it appears in the book. When I run it, however, I get an error message telling me that there is a "Syntax error in Constraint clause." I have checked and checked and I am fairly certain that I typed it in right. Anyway, here is the code from the book.

CREATE TABLE Manufacturers
(
ManufacturerID INTEGER CONSTRAINT ManfID PRIMARY KEY,
ToyID INTEGER NOT NULL,
CompanyName CHAR (50) NOT NULL,
Address CHAR (50) NOT NULL,
City CHAR (20) NOT NULL,
State CHAR (2) NOT NULL,
AreaCode CHAR (3) NOT NULL,
PhoneNumber CHAR (8) NOT NULL UNIQUE,
CONSTRAINT ToyFk FOREIGN KEY (ToyID) REFERENCES Toys (ToyID) 
ON UPDATE CASCADE 
ON DELETE CASCADE
);

Does Access 2007 support constraints? If so, then could you please offer a guess as to what the problem could be? Oh, and yes, I did previously create the Toys table, so it can't be generating an error because of that being missing.

Ren
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 954 | Replies: 0
Thread Tools Search this Thread



Tag cloud for Legacy and Other Languages
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC