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?
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?