Solved

Syntax error in CONSTRAINT clause.  Access 2000 jet 4.0

Posted on 2003-11-14
3
567 Views
Last Modified: 2007-12-19
I am trying to execute the following statement from in Access and I get the error: "Syntax error in CONSTRAINT clause"

Can anyone shed some light on what might be wrong?  I have already created the LAYER table which is being referenced.

ALTER TABLE FEATURE ADD CONSTRAINT FEATURE_LAYER_FK FOREIGN KEY (layer_code) REFERENCES LAYER (layer_code) ON DELETE CASCADE

If I remove the "ON DELETE CASCADE", the statement works fine.  

thanks
Bryan


0
Comment
Question by:bryanwells
  • 2
3 Comments
 
LVL 39

Expert Comment

by:stevbe
ID: 9749244
Your mdb needs to be using the SQL Server Compatible (ANSI 92) mode.
Tools | Options | Tables\Queries check the box.

Keep in mind that this will effect how all of your SQL statements are processed so be sure to create a backup first.

Steve
0
 

Author Comment

by:bryanwells
ID: 9750078
When I look at my Tools | Options | Tables\Queries, I do not see any check box for SQL Server Compatible or ANSI 92.  

I see Default Field Sizes
          Text:
          Number:

Default Field Type:

AutoIndex on Import/Create:

Query Design
          show table names
          output all fields
          Enable AutoJoin

Run permissions
          Owner's
           User's

Is there some kind of plug-in or extension I am supposed to install for this to work?  

I am using Access 2000 (9.0.3821 SR-1)

thanks
Bryan
0
 
LVL 39

Accepted Solution

by:
stevbe earned 250 total points
ID: 9763208
That option is only available for 2002, I do not think you can use the ALTER table statement you want to in 2000. You could look into using the Relation object in the DAO object library.

Steve
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now