Click to See Complete Forum and Search --> : Executing "ALTER" statement causes duplicate/backup tables in Access?


Golovko
July 7th, 2005, 01:46 PM
I have a table Location and a table Control for an Access mdb file.

I am programatically creating these tables using CDatabase.ExecuteSQL function. The Location table is created first and then then Control table, because Control has a fk into Location. Location however has an fk into Control. So after the two create statement, I execute an alter statement to add the new constraint to the Location table.

The problem is when I open the .mdb up in Access, it shows two tables when I open the Relationships window, Location and Location_1. Location_1 has the new constraint that I added with the alter statement. How can this be fixed?

jp140768
July 11th, 2005, 09:15 AM
I don't think you are getting a duplicate table, its just showing you that you are using the same table twice. You will get the same thing using a query, if you use a table more than once. For example I have a helpdesk system, one of my table contains the problems, along with the person who made the call, and the person investigating the call. So my query has helpdesk call, and two occurances of the Users table one linked by requestor and one by investigator. I see the second table as USER_1.