Solved

Syntax error in CONSTRAINT clause.  Access 2000 jet 4.0

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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 …

752 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