Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Apr 2006
    Location
    California
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TableDefs.Delete (Access 2003 SP2)

    Using db.Tabledefs.Append I'm successfully adding tables to a series of databases that I have specified. However, I'm attempting to delete these same tables with the db.TableDef.Delete and receiving the error that the table is not in the collection. If I use code to loop through the TableDefs, the tables don't show. But, if I do a File > Get External Data > Link Tables, I can see the tables and successfully manually link them. The databases in which I'm adding the tables are in Access 97 while I'm using Access 2003 to add the tables. Appreciate any insight anyone can provide.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TableDefs.Delete (Access 2003 SP2)

    Did you happen to give the tables names starting with "msys"? Or did you make them hidden?

  3. #3
    Star Lounger
    Join Date
    Apr 2006
    Location
    California
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TableDefs.Delete (Access 2003 SP2)

    Hans,

    No I didn't use a msys prefex or make them hidden. The table names are in the form A_tblsomename.

    Marty

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TableDefs.Delete (Access 2003 SP2)

    Does it help if you execute db.TableDefs.Refresh before trying to delete the tables?

    If not, I don't think there's much we can do to help without seeing the database. If you wish, you can post a stripped down copy of the database, see <post#=401925>post 401925</post#> for instructions.

  5. #5
    Star Lounger
    Join Date
    Apr 2006
    Location
    California
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TableDefs.Delete (Access 2003 SP2)

    Yes that takes care of the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •