Question : Dropping a column that is indexed.

I have a program that uses an Access 2000 DB.

I have a column called AutoNum that appears as the last column in the DB that is also set to Indexed (Duplicates OK).

What I need to do is either insert a column BEFORE that column, or drop AutoNum, add my new column, and add the AutoNum column back.

The problem is that when I try to drop the AutoNum column I get an error that says:

Cannot delete a field that is part of an index or is needed by the system.

My question is:
 Is there a way to drop a acolumn that in indexed
OR
 If not, can I insert a column before that one.
OR
 If not,, what can I do to workaround this?

Thanks for your time - this list is great.
Acrocat

Answer : Dropping a column that is indexed.

I see - can the conduit sync from a query rather than a table ? If so you can create a query with the fields in whatever order you need.

If not, the syntax for the ALTER TABLE command is:
ALTER TABLE MyTable DROP CONSTRAINT MyIndexName

You can check the name of the index by opening the table in design view and clicking View->Indexes.

However, you should be able to use the OrdinalPosition property of a field (in DAO) to change the position of a field within the TableDef. I've not actually done this myself but I think it would work.
Random Solutions  
 
programming4us programming4us