ODBC TableDefs Collection problem. Also posted on MS NewsGroups.

  • Thread starter DaveO via AccessMonster.com
  • Start date
D

DaveO via AccessMonster.com

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.
 

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