How to Delete Hidden Table in Back-end

B

Bill Sturdevant

I am linking from a front-end to a back-end replica quite
successfully. However, there is one table that conflicts
occur in and I don't want to be bothered by those. The
replication FAQ says to delete that file before I try to
resolve conflicts.

I have been unable to do that programmatically. The table
is created automatically by Access and is hidden.

The following code does not delete it. It fails without
an error message.

Dim db As Database
Set db = CurrentDb()
db.TableDefs.Delete "Tbl_XXXXXXXXXX_Conflict"
db.Close

What am I missing?
 
B

Bruce M. Thompson

The following code does not delete it. It fails without
an error message.

Dim db As Database
Set db = CurrentDb()
db.TableDefs.Delete "Tbl_XXXXXXXXXX_Conflict"
db.Close

What am I missing?

The table is located in the back-end, right? Your code is only looking in the
front-end (CurrentDb). You need to use the "OpenDatabase()" method to set "db"
to the back-end database file, then delete from db's tabledefs collection.
 

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

Top