I’m creating the table with this command:
CREATE TABLE Comp (
SerialNumber Number Primary Key Not Null,
Make Text(12) Not Null,
Model Text(24) Not Null,
ProcessorType Text(24) Null,
ProcessorSpeed Int Not Null,
MainMemory Text(15) Not Null,
DiskSize Text(15) Not Null
);
Which works I then try to add the constraint:
ALTER TABLE Comp
ADD CONSTRAINT CheckSpeed
CHECK (ProcessorSpeed > 0);
Which returns the error: “Syntax Error in CONSTRAINT Clause”.
I’ve tried adding:
CHECK (ProcessorSpeed > 0)
To the table creation command but it returns the same error. Is there any way to solve this?
You need to run against a connection and Comp is a reserved word.
Info: Constraints
Reserved words in Jet/Access pre 2007 and ACE/Access 2007-