Solved

Syntax error in CONSTRAINT clause.  Access 2000 jet 4.0

Posted on 2003-11-14
3
582 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

623 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