By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,106 Members | 2,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,106 IT Pros & Developers. It's quick & easy.

RunCommand acCmdLinkTables Fails in Access 2007 (Error 2046)

P: n/a
I have recently installed Office 2007 (SP1) retaining the previous
installation of Office 2003.

I have converted an Access 2003 database to Access 2007. The database
contains the VBA code 'DoCmd.RunCommand acCmdLinkTables' to initiate
the dialog box to rebuild links to tables held in a back-end Access
database (which has also been converted from Access 2003 to Access
2007).

The code runs without problem in the original Access 2003 .mdb format
under Access 2003, yet when run in either Access 2003 .mdb format or
Access 2007 .accdb format under Access 2007 returns error 2046 with
the description 'The command or action 'LinkTables' isn't available
now.'

Refreshing the table links 'manually' in Access 2007 via the Ribbon
(External Data / Access) runs without error.

Any ideas welcomed!

Thanks, Tony.
Jan 10 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Does this do what you expect:
RunCommand acCmdLinkedTableManager

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<to*********@lineone.netwrote in message
news:d9**********************************@j78g2000 hsd.googlegroups.com...
>I have recently installed Office 2007 (SP1) retaining the previous
installation of Office 2003.

I have converted an Access 2003 database to Access 2007. The database
contains the VBA code 'DoCmd.RunCommand acCmdLinkTables' to initiate
the dialog box to rebuild links to tables held in a back-end Access
database (which has also been converted from Access 2003 to Access
2007).

The code runs without problem in the original Access 2003 .mdb format
under Access 2003, yet when run in either Access 2003 .mdb format or
Access 2007 .accdb format under Access 2007 returns error 2046 with
the description 'The command or action 'LinkTables' isn't available
now.'

Refreshing the table links 'manually' in Access 2007 via the Ribbon
(External Data / Access) runs without error.

Any ideas welcomed!

Thanks, Tony
Jan 11 '08 #2

P: n/a
On 11 Jan, 04:26, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
Does this do what you expect:
* * RunCommand acCmdLinkedTableManager

--
Allen Browne - Microsoft MVP. *Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<tony.abb...@lineone.netwrote in message

news:d9**********************************@j78g2000 hsd.googlegroups.com...
I have recently installed Office 2007 (SP1) retaining the previous
installation of Office 2003.
I have converted an Access 2003 database to Access 2007. *The database
contains the VBA code 'DoCmd.RunCommand acCmdLinkTables' *to initiate
the dialog box to rebuild links to tables held in a back-end Access
database (which has also been converted from Access 2003 to Access
2007).
The code runs without problem in the original Access 2003 .mdb format
under Access 2003, yet when run in either Access 2003 .mdb format or
Access 2007 .accdb format under Access 2007 returns error 2046 with
the description 'The command or action 'LinkTables' isn't available
now.'
Refreshing the table links 'manually' in Access 2007 via the Ribbon
(External Data / Access) runs without error.
Any ideas welcomed!
Thanks, Tony- Hide quoted text -

- Show quoted text -
Thank you for your rapid response, Allen.

I have tried your suggestion and get a similar error, namely:

Error 2046: The command or action 'LinkedTableManager' isn't
available now.

Regards, Tony.

Jan 11 '08 #3

P: n/a
Tony, I've tried it with both MDB and ACCDB.
Works fine.

Are you sure there are any linked tables in this database?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tony" <to*********@lineone.netwrote in message
news:ae**********************************@c4g2000h sg.googlegroups.com...
On 11 Jan, 04:26, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
Does this do what you expect:
RunCommand acCmdLinkedTableManager

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<tony.abb...@lineone.netwrote in message

news:d9**********************************@j78g2000 hsd.googlegroups.com...
I have recently installed Office 2007 (SP1) retaining the previous
installation of Office 2003.
I have converted an Access 2003 database to Access 2007. The database
contains the VBA code 'DoCmd.RunCommand acCmdLinkTables' to initiate
the dialog box to rebuild links to tables held in a back-end Access
database (which has also been converted from Access 2003 to Access
2007).
The code runs without problem in the original Access 2003 .mdb format
under Access 2003, yet when run in either Access 2003 .mdb format or
Access 2007 .accdb format under Access 2007 returns error 2046 with
the description 'The command or action 'LinkTables' isn't available
now.'
Refreshing the table links 'manually' in Access 2007 via the Ribbon
(External Data / Access) runs without error.
Any ideas welcomed!
Thanks, Tony- Hide quoted text -

- Show quoted text -
Thank you for your rapid response, Allen.

I have tried your suggestion and get a similar error, namely:

Error 2046: The command or action 'LinkedTableManager' isn't
available now.

Regards, Tony.

Jan 11 '08 #4

P: n/a
On 11 Jan, 14:54, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
Tony, I've tried it with both MDB and ACCDB.
Works fine.

Are you sure there are any linked tables in this database?

--
Allen Browne - Microsoft MVP. *Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tony" <tony.abb...@lineone.netwrote in message

news:ae**********************************@c4g2000h sg.googlegroups.com...
On 11 Jan, 04:26, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:


Does this do what you expect:
RunCommand acCmdLinkedTableManager
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<tony.abb...@lineone.netwrote in message
news:d9**********************************@j78g2000 hsd.googlegroups.com...
>I have recently installed Office 2007 (SP1) retaining the previous
installation of Office 2003.
I have converted an Access 2003 database to Access 2007. The database
contains the VBA code 'DoCmd.RunCommand acCmdLinkTables' to initiate
the dialog box to rebuild links to tables held in a back-end Access
database (which has also been converted from Access 2003 to Access
2007).
The code runs without problem in the original Access 2003 .mdb format
under Access 2003, yet when run in either Access 2003 .mdb format or
Access 2007 .accdb format under Access 2007 returns error 2046 with
the description 'The command or action 'LinkTables' isn't available
now.'
Refreshing the table links 'manually' in Access 2007 via the Ribbon
(External Data / Access) runs without error.
Any ideas welcomed!
Thanks, Tony- Hide quoted text -
- Show quoted text -

Thank you for your rapid response, Allen.

I have tried your suggestion and get a similar error, namely:

Error 2046: *The command or action 'LinkedTableManager' isn't
available now.

Regards, Tony.- Hide quoted text -

- Show quoted text -
Allen,

I wasn't thinking when I tried your LinkedTableManager suggestion. At
that time there were no linked tables in the front-end database as
they had all been deleted in preparation for a total refresh by using
LinkTables.

I have now 'manually' linked the required tables using the Ribbon/
External Data/Access and run the following 2 commands.

RunCommand acCmdLinkedTableManager
RunCommand acCmdLinkTables

The LinkedTableManager operates as expected by verifying that all
links are OK. The LinkTables then fails with error 2046 'The command
or action 'LinkTables' isn't available now'.

My objective with this code is to support the roll-out of a new
version of the front-end database. As part of the release procedures
all linked tables in the new front-end database are programatically
deleted and then refreshed from the back-end database.

Thanks for your ongoing help in this matter.

Regards, Tony.
Jan 11 '08 #5

P: n/a
Okay, it's easy enough to programmatically check the link works in your
initialization code. If not, pop up the File Open dialog to ask the user
where the back end has gone.

Microsoft had some example code in solutions.mdb:
http://support.microsoft.com/kb/248674

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

==============================
"Tony" <to*********@lineone.netreplied in message
news:10**********************************@k2g2000h se.googlegroups.com...

Allen,

I wasn't thinking when I tried your LinkedTableManager suggestion. At
that time there were no linked tables in the front-end database as
they had all been deleted in preparation for a total refresh by using
LinkTables.

I have now 'manually' linked the required tables using the Ribbon/
External Data/Access and run the following 2 commands.

RunCommand acCmdLinkedTableManager
RunCommand acCmdLinkTables

The LinkedTableManager operates as expected by verifying that all
links are OK. The LinkTables then fails with error 2046 'The command
or action 'LinkTables' isn't available now'.

My objective with this code is to support the roll-out of a new
version of the front-end database. As part of the release procedures
all linked tables in the new front-end database are programatically
deleted and then refreshed from the back-end database.

Thanks for your ongoing help in this matter.

Regards, Tony.

Jan 12 '08 #6

P: n/a
On 12 Jan, 01:48, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
Okay, it's easy enough to programmatically check the link works in your
initialization code. If not, pop up the File Open dialog to ask the user
where the back end has gone.

Microsoft had some example code in solutions.mdb:
* *http://support.microsoft.com/kb/248674

--
Allen Browne - Microsoft MVP. *Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

==============================
"Tony" <tony.abb...@lineone.netreplied in messagenews:10**********************************@k 2g2000hse.googlegroups.com...

Allen,

I wasn't thinking when I tried your LinkedTableManager suggestion. *At
that time there were no linked tables in the front-end database as
they had all been deleted in preparation for a total refresh by using
LinkTables.

I have now 'manually' linked the required tables using the Ribbon/
External Data/Access and run the following 2 commands.

RunCommand acCmdLinkedTableManager
RunCommand acCmdLinkTables

The LinkedTableManager operates as expected by verifying that all
links are OK. *The LinkTables then fails with error 2046 'The command
or action 'LinkTables' isn't available now'.

My objective with this code is to support the roll-out of a new
version of the front-end database. *As part of the release procedures
all linked tables in the new front-end database are programatically
deleted and then refreshed from the back-end database.

Thanks for your ongoing help in this matter.

Regards, Tony.
Allen,

Thank you for your suggestion. However it doesn't fully achieve my
objective as, although existing links would be refreshed, any links
required to new tables in the back-end datasbase would not be
created. This additional functionality was an integral part of the
LinkTables command.

I have persevered over the weekend have now successfully resolved the
issue. Quite simply, the LinkTables command appears to have been
replaced by ImportAttachAccess. The code 'DoCmd.RunCommand
acCmdImportAttachAccess' exactly mimics the 'manual' approach using
Ribbon / External Data / Access and achieves my objectives precisely.
.
Thank you again for your help over the last few days.

Regards, Tony.
Jan 13 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.