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
Solved

Syntax error in CONSTRAINT clause.  Access 2000 jet 4.0

Posted on 2003-11-14
3
575 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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 …

790 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