会员登录 - 用户注册 - 网站地图 Office中国(office-cn.net),专业Office论坛
当前位置:主页 > 技巧 > Access技巧 > ActiveX控件图表 > 正文

Access2010使用Treeview出现问题的解决办法(适合32位及64位)(3)

时间:2013-10-01 22:34 来源:网络 作者:Access中国录入员 阅读:

有关如何以管理员身份启动程序的更多信息,请转到以下 Microsoft 网页:
有关如何注册 ActiveX 控件的详细信息,请单击下面的文章编号,以查看 Microsoft 知识库中相应的文章:
2746232 (页面可能为英文) 如何手动注册 ActiveX 控件 (.ocx)

7.FMS提供的解决办法 

   原文:  http://www.fmsinc.com/MicrosoftAccess/Controls/mscomctl/?goback=%2Egde_937037_member_154050465#%21

  修复 Microsoft Windows Common Control Library (MSCOMCTL.OCX) 安装更新导致的问题

Microsoft Office 的新的安全更新

在2012年8月14日,微软发布了一个安装更新补丁,里面包含了Windows Common Control MSCOMCTL.OCX的更新: 
 

文件名 文件版本 文件大小 日期 时间
Mscomctl.ocx 6.01.9834 1,070,152 07-Jun-2012 03:59

注意这个控件的日期是6月份,但它是包含在这个8月份的安全补丁包中.

微软针对这个补丁的相关知识库(KB)

微软版本

以下版本:

  • Windows XP, Vista, Windows 7 (32/64 bit)
  • Windows Server 2003, 2008, 2008 R2

使用这个更新可能导致的问题

After installing the update, the Windows Common Control Library does not work. The issue seems to stem around a defective installation or registration of the OCX file. This update causes problems with existing Microsoft Access, VB6 and other applications using common controls such as the Treeview and Listbox controls.

The symptoms are rather odd. It's not as if the control is completely missing or not registered. The control exists but does not behave correctly as events are not firing correctly. For instance, the Treeview control don't issue NodeClick events, so any code that expects the expansion of a node to display or load more data fails. It took us a while to discover that a change in this control caused this problem.

In other cases, users are reporting that Microsoft Access locks up and crashes. People are also reporting problems with this in Visual Basic 6 (VB6) applications. Here are additional reports of issues associated with this patch.

Impact on Total Access Analyzer

This impacts our Total Access Analyzer product which displays the results of your Microsoft Access database documentation with the Treeview control. This error appears:

Error 459 - Object or class does not support the set of events, Procedure clsFrmExplorer_TAA.InitForm

If your PC received the security update and you're using the Microsoft Access 2010, 2007, 2003, 2002, or 2000 version of Total Access Analyzer, the Treeview control in our Database Explorer view no longer functions properly.

Known Issues as Reported by Microsoft

Microsoft has acknowledged problems with their security update that is causing these problems. The issue is caused by a registration of the updated MSCOMCTL.OCX file. Microsoft has released a Knowledgebase article 2687441 addressing this problem entitled: MS12-060: Description of the security update for 2007 Office system: August 14, 2012.

In that article, they mention the known issues with the security update:

Windows Common Control-based embedded ActiveX controls may fail to load within pre-existing office documents, within third-party applications, and when you insert new controls in developer mode. For example, depending on your operating system, you can type the either of the following commands at an elevated command prompt, and then press Enter:
  • For 64-bit operating systems, type the following: 
    Regsvr32 "C:\Windows\SysWOW64\MSCOMCTL.OCX"
  • For 32-bit operating systems, type the following: 
    Regsvr32 "C:\Windows\System32\MSCOMCTL.OCX"

The article goes into details about unregistering the control and re-registering it using a batch file calling REGEDIT.EXE.

Microsoft's Suggested Solution Fails

In our internal testing, we've discovered that the recommended steps don't work in most cases. Just unregistering and re-registering the control doesn't solve the problem. We tried adding a reboot between steps, but that didn't help either. The steps below work consistently. An technical explanation why is given at the end.

Our Steps for Fixing the Registration of the Windows Common Control

While there seems to be nothing physically wrong with the new OCX, we need to register another version to reset it. Here are the steps we discovered to manually repair this issue reliably and consistently:

  • Unregister the new MSCOMCTL.OCX and make a backup of it
  • Install and register an old (legacy) version of the MSCOMCTL.OCX file
  • Replace the legacy control with the new one
  • Re-register the new control

Command Prompt Run as AdministratorWindows Command Prompt and Security Permissions

You need Administrator rights to make registry changes. Depending on your operating system and Windows login rights, you may not be allowed to do this.

From your Windows Start button under, All Programs, Accessories, launch the Command Prompt by right clicking on it and choosing "Run as administrator".

You can then copy the Regsvr32.exe command lines described below into the dialog.

32 Bit Windows

  1. Unregister the new OCX file. Open an instance of the Windows Command Prompt, paste the following command, and press <Enter>:
    Regsvr32.exe /u C:\Windows\System32\MSCOMCTL.OCX
  2. Make a backup of the OCX file C:\Windows\System32\MSCOMCTL.OCX to C:\Windows\System32\MSCOMCTL.bak
  3. Copy a legacy version of the MSCOMCTL.OCX file to your C:\Windows\System32 folder. For your convenience, a zipped copy from 2011 is here.
  4. Register this legacy OCX file with the following command:
    Regsvr32.exe C:\Windows\System32\MSCOMCTL.OCX
  5. Unregister this legacy version of the OCX file:
    Regsvr32.exe /u C:\Windows\System32\MSCOMCTL.OCX
  6. Delete the legacy OCX file: C:\Windows\System32\MSCOMCTL.OCX
  7. Rename the new OCX file we renamed in step 2, back to its original name:
    C:\Windows\System32\MSCOMCTL.bak to C:\Windows\System32\MSCOMCTL.OCX
  8. Re-register the new version of the OCX file. Paste the following command and press <Enter>:
    Regsvr32.exe C:\Windows\System32\MSCOMCTL.OCX
  9. Reboot the computer.
  10. Open Microsoft Access and then retest the control. It should be working at this point.

64 bit Windows

The 64-bit steps are identical to the 32 bit version except the folder is SYSWOW64 rather than SYSTEM32:

  1. Unregister the new OCX file. Open an instance of the Windows Command Prompt, paste the following command, and press <Enter>:
    Regsvr32.exe /u C:\Windows\SYSWOW64\MSCOMCTL.OCX
  2. Make a backup of the OCX file C:\Windows\SYSWOW64\MSCOMCTL.OCX to C:\Windows\SYSWOW64\MSCOMCTL.bak
  3. Copy a legacy version of the MSCOMCTL.OCX file to your C:\Windows\SYSWOW64 folder. For your convenience, a zipped copy from 2011 is here.
  4. Register this legacy OCX file with the following command:
    Regsvr32.exe C:\Windows\SYSWOW64\MSCOMCTL.OCX
  5. Unregister this legacy version of the OCX file:
    Regsvr32.exe /u C:\Windows\SYSWOW64\MSCOMCTL.OCX
  6. Delete the legacy OCX file: C:\Windows\SYSWOW64\MSCOMCTL.OCX
  7. Rename the new OCX file we renamed in step 2, back to its original name:
    C:\Windows\SYSWOW64\MSCOMCTL.bak to C:\Windows\SYSWOW64\MSCOMCTL.OCX
  8. Re-register the new version of the OCX file. Paste the following command and press <Enter>:
    Regsvr32.exe C:\Windows\SYSWOW64\MSCOMCTL.OCX
  9. Reboot the computer.
  10. Open Microsoft Access and then retest the control. It should be working at this point.

Why This Solution Works

The reason why Microsoft's recommendation to un-register and re-register the new MSCOMCTL.OCX Common Control fails is because it doesn't overwrite the legacy control's registry on the machine. Industry colleague, Andrew Rohm provides this nice explanation:

The problem is that the update leaves some old 2.0 Version entries in the Registry. The previous MSCOMCTL.OCX carried the version number 2.0 (the *File* Version is 6.something but in the registry it's known as Version 2.0).
The new file version is 6.1.98.34 but Version 2.1 in the registry. Here we are talking about registry entry:
HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}
The patch installs the new version but leaves a part of the old registry settings.

By installing and uninstalling the legacy control, it cleans up the 2.0 registry so the new version is installed properly. The offending registry that needs to be deleted is:

HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.0



We have the same problem. In our Add-In, we were able to trace the problem to a declaration of a variable as Excel.Application. The reference to this object is in the Excel.exe file, so it is very unclear as to which files got messed up.

The machines that have this problem were all updated early this morning (15 Aug 2012) with the following updates (sorry for not posting links, as a new user, I'm limited to only two per post):

Security Update for Microsoft Office 2007 suites (KB2596615)

Security Update for Microsoft Office 2007 suites (KB2596754)

Security Update for Microsoft Office 2007 suites (KB2596856)

Security Update for Microsoft Office 2007 suites (KB2687441)

Update for Microsoft Office Outlook 2007 Junk Email Filter (KB2687400)

Windows Malicious Software Removal Tool x64 - August 2012 (KB890830)

At present, we have not found any information on the MSDN site that could clear this up. We're still trying to isolate this down further.



Same issue here today after performing the update for Office 2007 Excel. Oddly, one system had no issues despite the update - the newest system. So after some inspection, I noticed this trouble-free system had different version of MSCOMCTL.OCX in windows\sysWOW64 then others. Here are the details of this activeX Size: 1,070,152 bytes created: 6/3/2012 modified: 6/6/2012 product version: 6.01.9834 So I copied this to the trouble one and it did the trick.

Also, you might want to check if these application extensions are present in windows\sysWOW64 or windows\system32 for 32-bit system FM20.DLL (Modified Date: 7/7/2011, version 12.0.6604.1000, 1.13MB) FM20ENU.DLL (Modified Date: 10/24/2008, version 12.0.6413.1000, 32.3KB) Not sure where you can download these. I cannibalized them from other systems.

5. 另一个有效的解决办法



This article applies to Word, Access, Excel and PowerPoint. MS12-060 is a security update that was released Tuesday, August 14, 2012. This update replaced MS12-027. You may now be seeing one of the following errors:

"Unspecified Automation Error" when running or compiling your Microsoft Office VBA code after installing MS12-060;

or

"Errors were detected while saving 'filename.xlsm'. Microsoft Office Excel may be able to save the file by removing or repairing some features. To make the repairs in a new file, click Continue. To cancel saving the file, click Cancel."
 
clicking continue you will see "Document failed to save" or similar error.
 
Update - 9/26/2012. See this blog post for the latest update.
 
Fixit Available
 
There is a fixit available for this problem:
 
Office 2010 w SP1 - http://support.microsoft.com/kb/2597986
 
Office 2007 w SP2 or SP3 - http://support.microsoft.com/kb/2687441
 
Office 2003 w SP3 or Office 2003 Web Components w SP3 - http://support.microsoft.com/kb/2687323
 
Steps to fix the problem manually

Alternatively, the manual fix for this problem is to re-register MSCOMCTL.OCX. To do this, follow these steps:

1. Open an administrative-level command prompt. The command prompt MUST be on the administrative level for this to work. Click START, and type RUN in the run command line. On Windows Vista and Windows 7 you will see CMD.EXE appear in the quick search list. Right click CMD.EXE and left click Run As Administrator. A black command prompt opens. On Windows XP, there is no built-in run-as-admin, but you can use the run as menu option (or runas command line) to execute an admin command from a Limited User Account.

2. If on a 64-bit machine, type the following:

regsvr32.exe /u  C:\Windows\SysWOW64\MSCOMCTL.OCX

Hit ENTER

then type

regsvr32.exe  C:\Windows\SysWOW64\MSCOMCTL.OCX

If on a 32-bit machine, type the following:

regsvr32.exe /u C:\Windows\System32\MSCOMCTL.OCX

hit ENTER

then type

regsvr32.exe C:\Windows\System32\MSCOMCTL.OCX

Your Office program should work again after doing this.

(Updated) 3. NOTE: The following step is done at your own risk. Microsoft doesn't know about any side effects to deleting this registry key. In cases where the re-registration doesn't work and you still get the error, you will need to open the registry editor (START > RUN > REGEDIT) and find and DELETE the following registry key:

HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.0

to

HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.0OLD

We've heard reports that renaming the key doesn't work. The key has to be deleted.

Afterward, follow steps 1 and 2 to unregister and re-register MSCOMCTL.OCX

Automating a Solution for Multiple Machines

You can also include the unregistration and re-registration in a batch file that is pushed out to multiple machines. Here is a sample script which should do the job:

reg delete hkcr\typelib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.0 /f

if exist %systemroot%\SysWOW64\cscript.exe goto 64 
%systemroot%\system32\regsvr32 /u mscomctl.ocx

(责任编辑:admin)

顶一下
(0)
0%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价: