• VS2010中ActiveX控件"未能实例化activex控件 因为这需要设计时授权"解决办法


    用MFC编程时,通过ADO连接数据库,需要用到ADO相关的ActiveX控件,在VC++6.0中是默认有的,但VS2010中必须要手动添加。在对话框中添加控件时,若遇到“未能实例化activex控件 因为这需要设计时授权”提示,解决办法如步骤3。

    具体步骤如下:

    1、下载*.ocx文件

    最常用的三个为:MSADODC.OCX,MSDATGRD.OCX,MSDATLST.OCX,并把它们保存在目录C:WindowsSystem32下

    各个控件需要的文件以及包含的控件如下:

    Microsoft ADO Data Control 6.0  MSADODC.OCX ADO Data Control

    Microsoft Data Grid Control 6.0  MSDATGRD.OCX  DataGrid 

    Microsoft Data List Controls 6.0   MSDATLST.OCX  DataList, DataCombo 

    Microsoft Data Bound Grid Control 5.0  DBGRID32.OCX DBGrid 

    Microsoft Data Bound List Controls 6.0 DBLIST32.OCX  DBList, DBCombo 

    Microsoft Data Repeater Control 6.0  MSDATREP.OCX DataRepeater 

    Microsoft FlexGrid Control 6.0  MSFLXGRD.OCX MSFlexGrid 

    2、注册

    开始-->运行/命令提示符-->输入regsvr32 msadodc.ocx,回车后会弹出注册成功提示框

    或者在VS的工具-->VisualStdio 命令提示符下输入regsvr32 msadodc.ocx

    注册完所有需要的文件之后,在VS2010的工具-->选择工具箱项,COM组件中,找到相应的控件名,勾选并确定。这时在资源视图中就可以右键-->添加ActiveX控件中选择相应控件了

    3、“未能实例化activex控件 因为这需要设计时授权”解决办法

    若添加控件时,弹出提示框“未能实例化activex控件 因为这需要设计时授权”,则可以找到VC++6.0安装文件中的*.reg文件,双击导入注册表。

    若还未能解决,可新建文本文件,将下面的文字复制,重命名为adocontrol.reg。双击导入注册表,再添加控件就不会提示出错了。

    REGEDIT
    HKEY_CLASSES_ROOTLicenses = Licensing: Copying the keys may be a violation of established copyrights.

    // Masked Edit Control 6.0 license key
    HKEY_CLASSES_ROOTLicensesBC96F860-9928-11cf-8AFA-00AA00C00905 = mmimfflflmqmlfffrlnmofhfkgrlmmfmqkqj

    // Chart Control 6.0 (OLEDB) license key
    HKEY_CLASSES_ROOTLicenses12B142A4-BD51-11d1-8C08-0000F8754DA1 = aadhgafabafajhchnbchehfambfbbachmfmb

    // Common Dialog Control 6.0 license key
    HKEY_CLASSES_ROOTLicenses4D553650-6ABE-11cf-8ADB-00AA00C00905 = gfjmrfkfifkmkfffrlmmgmhmnlulkmfmqkqj

    // ADO Data Control 6.0 (OLEDB) license key
    HKEY_CLASSES_ROOTLicensesC4145310-469C-11d1-B182-00A0C922E820 = konhqhioohihphkouimonhqhvnwiqhhhnjti

    // Common Controls-3 6.0 license key
    HKEY_CLASSES_ROOTLicenses38911DA0-E448-11D0-84A3-00DD01104159 = mcpckchcdchjcjcclidcgcgchdqdcjhcojpd

    // Windows Common Controls-2 5.0 (SP2) license key
    HKEY_CLASSES_ROOTLicenses9E799BF1-8817-11cf-958F-0020AFC28C3B = uqpqnqkjujkjjjjqwktjrjkjtkupsjnjtoun

    // Windows Common Controls license key
    HKEY_CLASSES_ROOTLicenses57CBF9E0-6AA7-11cf-8ADB-00AA00C00905 = aahakhchghkhfhaamghhbhbhkbpgfhahlfle

    // Data Bound Grid Control 5.0(SP3) license key
    HKEY_CLASSES_ROOTLicenses556C75F1-EFBC-11CF-B9F3-00A0247033C4 = xybiedobrqsprbijaegcbislrsiucfjdhisl

    // Data Bound List Controls 6.0 license key
    HKEY_CLASSES_ROOTLicenses96EFC40-6ABF-11cf-850C-08002B30345D = knsgigmnmngnmnigthmgpninrmumhgkgrlrk

    // Internet Transfer Control 6.0 license key
    HKEY_CLASSES_ROOTLicenses78E1BDD1-9941-11cf-9756-00AA00C00908 = yjrjvqkjlqqjnqkjvprqsjnjvkuknjpjtoun

    // Multimedia Control 6.0 license key
    HKEY_CLASSES_ROOTLicensesB1EFCCF0-6AC1-11cf-8ADB-00AA00C00905 = qqkjvqpqmqjjpqjjvpqqkqmqvkypoqjquoun

    // Chart Control 6.0 license key
    HKEY_CLASSES_ROOTLicenses7C35CA30-D112-11cf-8E72-00A0C90F26F8 = whmhmhohmhiorhkouimhihihwiwinhlosmsl

    // Windows Common Controls-2 6.0 license key
    HKEY_CLASSES_ROOTLicenses4F86BADF-9F77-11d1-B1B7-0000F8753F5D = iplpwpnippopupiivjrioppisjsjlpiiokuj

    // Windows Common Controls 6.0 license key
    HKEY_CLASSES_ROOTLicensesED4B87C4-9F76-11d1-8BF7-0000F8754DA1 = knlggnmntgggrninthpgmnngrhqhnnjnslsh

    // Comm Control 6.0 license key
    HKEY_CLASSES_ROOTLicenses4250E830-6AC2-11cf-8ADB-00AA00C00905 = kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun

    // DataGrid Control 6.0 (OLEDB) license key
    HKEY_CLASSES_ROOTLicensesCDE57A55-8B86-11D0-b3C6-00A0C90AEA82 = ekpkhddkjkekpdjkqemkfkldoeoefkfdjfqe

    // DataList Control 6.0 (OLEDB) license key
    HKEY_CLASSES_ROOTLicensesA133F000-CCB0-11d0-A316-00AA00688B10 = cibbcimbpihbbbbbnhdbeidiocmcbbdbgdoc

    // DBWin license key
    HKEY_CLASSES_ROOTLicensesD015B071-D2ED-11d0-A31A-00AA00688B10 = gjdcfjpcmjicjcdcoihcechjlioiccechepd

    // MSDBRPT license key
    HKEY_CLASSES_ROOTLicenses9DF1A470-BA8E-11D0-849C-00A0C90DC8A9 = cchcqjejhcgcqcfjpdfcdjkckiqikchcojpd

    // FlexGrid Control 6.0 license key
    HKEY_CLASSES_ROOTLicenses72E67120-5959-11cf-91F6-C2863C385E30 = ibcbbbebqbdbciebmcobmbhifcmciibblgmf

    // MAPI Controls 6.0 license key
    HKEY_CLASSES_ROOTLicenses899B3E80-6AC6-11cf-8ADB-00AA00C00905 = wjsjjjlqmjpjrjjjvpqqkqmqukypoqjquoun

    // MSRDO 2.0 license key
    HKEY_CLASSES_ROOTLicensesB1692F60-23B0-11D0-8E95-00A0C90F26F8 = mjjjccncgjijrcfjpdfjfcejpdkdkcgjojpd

    // RemoteData Control 6.0 license key
    HKEY_CLASSES_ROOTLicenses43478d75-78e0-11cf-8e78-00a0d100038e = imshohohphlmnhimuinmphmmuiminhlmsmsl

    // Windowless Controls 6.0 license key
    HKEY_CLASSES_ROOTLicenses80E80EF0-DBBE-11D0-BCE2-00A0C90DCA10 = qijimitpmpnpxplpvjnikpkpqoxjmpkpoivj

    // PictureClip Control 6.0 license key
    HKEY_CLASSES_ROOTLicenses6FB38640-6AC7-11cf-8ADB-00AA00C00905 = gdjkokgdldikhdddpjkkekgknesjikdkoioh

    // Rich TextBox Control 6.0 license key
    HKEY_CLASSES_ROOTLicensesDC4D7920-6AC8-11cf-8ADB-00AA00C00905 = iokouhloohrojhhhtnooiokomiwnmohosmsl

    // Sheridan Tab Control license key
    HKEY_CLASSES_ROOTLicenses190B7910-992A-11cf-8AFA-00AA00C00905 = gclclcejjcmjdcccoikjlcecoioijjcjnhng

    // SysInfo Control 6.0 license key
    HKEY_CLASSES_ROOTLicensesE32E2733-1BC5-11d0-B8C3-00A0C90DCA10 = kmhfimlflmmfpffmsgfmhmimngtghmoflhsg

    // Winsock Control 6.0 license key
    HKEY_CLASSES_ROOTLicenses2c49f800-c2dd-11cf-9ad6-0080c7e7b78d = mlrljgrlhltlngjlthrligklpkrhllglqlrk

  • 相关阅读:
    129. Sum Root to Leaf Numbers
    113. Path Sum II
    114. Flatten Binary Tree to Linked List
    112. Path Sum
    100. Same Tree
    300. Longest Increasing Subsequence
    72. Edit Distance
    自定义js标签库
    JS 实现Table相同行的单元格自动合并示例代码
    mysql 高版本only_full_group_by 错误
  • 原文地址:https://www.cnblogs.com/shikamaru/p/7692985.html
Copyright © 2020-2023  润新知