[AccessD] Wierd tabledefs problem.

Bobby Heid bheid at appdevgrp.com
Fri Dec 5 13:26:50 CST 2003


Hi all,

We have some code that updates a BE table based upon a template table.  This
function has been working for about a million years.

Anyway, after this function has updated some other tables, I go to update a
particular table.  When setting the tabledefs variable with 

Set tdfTarget = ldbTarget.TableDefs(lstrTableName)

'lstrTableName="Project"

tdfTarget is Nothing after the assignment.

Now, this function also will add the table if it does not exist in the BE.
So when the above line fails, it proceeds to add the table to the BE
tabledefs.  Well, this fails because THE TABLE ALREADY EXISTS!!!!

I can open a recordset against the particular table in the be using the
ldbTarget variable.  I can also do a "? ldbTarget.TableDefs("Project").name"
in the immediate window and it tells me that it is not in the collection.
But when I do a "? ldbTarget.TableDefs("Contracts").name", it prints out
Contracts.

Anyone have any ideas as to what may be going on?

This is in Access 97 SP-2.  I have compacted and repaired the BE, used
JetComp on the BE and imported the BE into another MDB.

Thanks,
Bobby



More information about the AccessD mailing list