Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Syntax error in CONSTRAINT clause.  Access 2000 jet 4.0

Posted on 2003-11-14
3
Medium Priority
?
592 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 1000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

824 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