I would like to link an oracle table in the on_load event of a form and then delete the link on the unload event.
Does anyone have any samples?
I am currently using:
ON_LOAD
Dim dbsCurrent As Database
Dim tdfLinked As TableDef
Dim tdf As TableDef
DoCmd.Hourglass True
Set dbsCurrent = CurrentDb()
Set tdfLinked = dbsCurrent.CreateTableDef("Channel"
tdfLinked.Connect = "ODBC;DATABASE=XXXX;UID=XXXX;PWD=XXXX;DSN=XXXX"
tdfLinked.SourceTableName = "Claims.Channel"
dbsCurrent.TableDefs.Append tdfLinked
tdfLinked.Attributes = dbHiddenObject
UNLOAD:
DoCmd.DeleteObject acTable, "Channel"
I then display some of the table information on the form.
The problem: Sometimes the information displays and sometimes it doesn't.
Would appreciate any assistance. Thanks!
Does anyone have any samples?
I am currently using:
ON_LOAD
Dim dbsCurrent As Database
Dim tdfLinked As TableDef
Dim tdf As TableDef
DoCmd.Hourglass True
Set dbsCurrent = CurrentDb()
Set tdfLinked = dbsCurrent.CreateTableDef("Channel"
tdfLinked.Connect = "ODBC;DATABASE=XXXX;UID=XXXX;PWD=XXXX;DSN=XXXX"
tdfLinked.SourceTableName = "Claims.Channel"
dbsCurrent.TableDefs.Append tdfLinked
tdfLinked.Attributes = dbHiddenObject
UNLOAD:
DoCmd.DeleteObject acTable, "Channel"
I then display some of the table information on the form.
The problem: Sometimes the information displays and sometimes it doesn't.
Would appreciate any assistance. Thanks!