Was just wondering if anyone here is an Access master

have this code that I want too add a CHECK too but keeps on throwing a syntax error

CREATE TABLE Email (
userEmailAddress memo not null, 
timeDate datetime not null,
contactEmailAddress memo not null,
emailBoxType text(6) not null,
readStatus binary(1) not null,
subject text(255),
message memo, 
primary key(userEmailAddress, timeDate),
)

and this is the check

CHECK (readStatus 'Y' 'N')

have tried all sorts of combination's but just can't get it to work, have googled and copied exactly how they use it but still just throws a syntax error.

Any help greatly appreciated.

Recommended Answers

All 2 Replies

CHECK constraint is not available in the CREATE TABLE statement for Access 2007 database.

Instead, you can define validation rule using Design View.

yeah did some further reading and couldn't find anything, so installed an app that reads the tables and exports the sql and you have to do it via ALTER TABLE

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.