How to check existence of Oracle table

  • Thread starter jer99 via AccessMonster.com
  • Start date
J

jer99 via AccessMonster.com

I have routines that link to specific oracle tables. Sometimes users do not
have the proper tables inside oracle. I hate to just leave them hanging.

I have all the required oracle table names in an Access table. I first delete
the existing linked tables then I open the Access table and loop through re-
linking them (we link to different Oracle schemas).
In the code below, the rs reference is the ADODB recordset of this Access
Table.

The code I use is:
Do While Not rs.EOF
Set tdfAccess = dbs.CreateTableDef(rs![odbctablename], dbAttachSavePWD)
tdfAccess.Connect = dbsODBC.Connect
tdfAccess.SourceTableName = dbsODBC.TableDefs(sSchema & "." & rs!
[odbctablename]).Name
dbs.TableDefs.Append tdfAccess
rs.MoveNext
Loop

I have an On Error Goto statement and when a table doesn't exist, it returns
an error # 3265
I could just tell the user at that point what is missing. However, I want to
check the existence of the tables in oracle before I go and delete all the
linked tables.

Any ideas?
 

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