D
DaveO
Guys, I have built this code so far...
Dim dbMe As DAO.Database
Dim dbBmthDb As DAO.Database
Dim wrkNewSpace As Workspace
Dim conConnect As Connection
Dim tblRemote As DAO.TableDef
Dim tblDbRemote As DAO.TableDef
Set dbMe = CurrentDb
Set wrkNewSpace = CreateWorkspace("NewODBCWorkspace", _
"admin", "", dbUseODBC)
Set dbBmthDb = wrkNewSpace.OpenDatabase("Application", , ,
"ODBC;DATABASE=Application;DSN=Stack1 Remote Tables;UID=****;PWD=****")
For Each tblRemote In dbBmthDb.TableDefs
MsgBox tblRemote.Name
Next tblRemote
Set dbMe = Nothing
Set wrkNewSpace = Nothing
Set dbBmthDb = Nothing
Now it's erroring when it gets to the For Each statement, saying that 'Error
3251 Operation is not supported for this type of object'.
I'm trying to reference the .tabledefs collection so not sure why this would
cuase me problems.
Any help would be great.
Thanks.
Dim dbMe As DAO.Database
Dim dbBmthDb As DAO.Database
Dim wrkNewSpace As Workspace
Dim conConnect As Connection
Dim tblRemote As DAO.TableDef
Dim tblDbRemote As DAO.TableDef
Set dbMe = CurrentDb
Set wrkNewSpace = CreateWorkspace("NewODBCWorkspace", _
"admin", "", dbUseODBC)
Set dbBmthDb = wrkNewSpace.OpenDatabase("Application", , ,
"ODBC;DATABASE=Application;DSN=Stack1 Remote Tables;UID=****;PWD=****")
For Each tblRemote In dbBmthDb.TableDefs
MsgBox tblRemote.Name
Next tblRemote
Set dbMe = Nothing
Set wrkNewSpace = Nothing
Set dbBmthDb = Nothing
Now it's erroring when it gets to the For Each statement, saying that 'Error
3251 Operation is not supported for this type of object'.
I'm trying to reference the .tabledefs collection so not sure why this would
cuase me problems.
Any help would be great.
Thanks.