Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 drop table

Author  Topic 

StefanbNamed
Starting Member

2 Posts

Posted - 2008-08-22 : 06:15:31
Dear Forum,

I want to drop some tables in my access database because these are already put to MySQL.

There are some keys on the table1 and there is a cascade delete from table1 to table2

Can anybody tell me how I can disable the keys that are on the table??
Is it possible to disable a cascade delete?

Which command do I have to use to drop those tables?
I tried "drop table table1" (no success)
Than I tried "delete * from table1".

I got the following error: "The record cannot be deleted or changed because table 'table2' includes related records.".

Thank you for your Input
Stefan

mircea.stancu
Starting Member

4 Posts

Posted - 2008-08-27 : 08:33:45
If you want to delete the table and not the records it includes, you must not use delete from table but drop table command. If the table is related to other tables, you must first delete all those relations and then run the drop table command.

Good luck!
Mircea
Go to Top of Page

StefanbNamed
Starting Member

2 Posts

Posted - 2008-08-27 : 09:06:33
quote:
Originally posted by mircea.stancu

If you want to delete the table and not the records it includes, you must not use delete from table but drop table command. If the table is related to other tables, you must first delete all those relations and then run the drop table command.

Good luck!
Mircea



Thank you for your reply,

but the database has been generated long before I worked here and I don't know which relations are on the table. Is there a command I can use to find out which relations there are on the table??

Stefan
Go to Top of Page

mircea.stancu
Starting Member

4 Posts

Posted - 2008-08-28 : 02:39:00
I don't know what version of MS Access you use, but you can generally see the relations in a graphical mode, and you can select the relation you want to delete by doing click on it and then you must press Delete button to delete it.
In MS Access 2003, for example, you must go to Tools-Relashions from the main menu and then add all your tables in your database. In this way you will see all the relashions so you can select and delete the ones you don't need, and even make new ones.

Good luck!
Mircea.
Go to Top of Page
   

- Advertisement -