Table missing is ADOX that actually exists

O

OceanView

I'm having a strange problem looping through toe ADOX.catalog object. I'm
looking for a series of tables whcich I'm copying from another database. I
refresh the catalog by deleteing the object as recreating it after copying
the tables (which I've noticed is necessary). Six of the seven tables show
up fine. The seventh doesn't isn't in the Tables collection (it's actually #
5 in the sequece of seven). The table DOES exists, and WAS copied
successfully. I verified this when the debugger breaks by checking the
tables.

Anybody experienced this?

Details: It's a linked databse using a direct (non_ODBC) connection, actually
connecting to the databse I'm running it from, but that's posed no problems
(except having to close the editor before running it to avoid a lockout).

Any help appreciated! Thanks!
 
O

OceanView

Pretty difficult to comment without seeing your code.

It's very long and some of is proprietary, so here's the essence of it. I'll
repeat again in case people don't read the first post: The table DOES EXIST.
(It was renamed prior to this step, which is why I need the refresh step) I
put the 'skipping' msgbox to avoid the "object not in collection" error. The
table in question is caled (name changed slightly with same length to protect
my job) tblxxxxxxApplicationHistory. The tables_exists function does the
same check, but traps the error and returns the boolean result.

Dim col As ADOX.Column
Dim out_tbl As ADOX.Table
Set toCat = Nothing
Set toCat = New ADOX.Catalog 'refresh yet again
toCat.ActiveConnection = outdb
If Not table_exists(toCat.Tables, outtbname) Then
MsgBox "can't find table " & outtbname & " -skipping"
GoTo next_tbl 'goto end of loop
End If
Set out_tbl = toCat.Tables(outtbname) 'fails if not skipped on
one table
 

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