DDL cannot be completed on this table because it is referenced by constraint <name> on table <name>.

J

Jürgen Germonpré

Dear All,

I've executed this query via ADODB:

CREATE TABLE Trevors (trevor_name VARCHAR(15) NOT NULL UNIQUE, trevor_type
VARCHAR(5) NOT NULL, CHECK (trevor_type IN ('Mail', 'Depot')), UNIQUE
(trevor_type, trevor_name));

As I want to delete the table i'm getting this 'unexpected error'.

I've deleted indexes, but this doesn't help a bit.

Does anybody has a clue?

Thanks.
 
M

Michael Gramelspacher

CREATE TABLE Trevors (trevor_name VARCHAR(15) NOT NULL UNIQUE, trevor_type
VARCHAR(5) NOT NULL, CHECK (trevor_type IN ('Mail', 'Depot')), UNIQUE
(trevor_type, trevor_name));

This worked for me in Access 2003. I just copied the name of
the constraint shown in the warning window when I tried to
delete the table and used the constraint name in the Alter
Table below. Then I deleted the table. Maybe try doing the
same.

With CurrentProject.AccessConnection
.Execute "ALTER TABLE Trevors DROP CONSTRAINT check_830AEDB2
_00F5_45C7"
End With
 
J

Jürgen Germonpré

Thank you for your info.

I've posted (sorry,sorry) the same question in another article
<[email protected]> as follow up of a conversation
already started.
And got +- the same info at +- the same time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top