你引用的 ADO 是什么版本?

解决方案 »

  1.   

    回of123:
    我引用的是: Microsoft AciveX Data Objects 2.6 Library
    在下面显示定位: C:\Program Files \Common Files\Sysem\ADO\msado26.tlb
      

  2.   

    打包文件中有没有 MDAC_TYP.EXE?
    去微软网站下一个 MDAC 2.6,把它替换掉,没有就加在安装报中。
      

  3.   

    回Tiger_Zhao:
    打包文件里有个MDAC_TYP.EXE,在运行setup的时候,发现有一个microsoft data access components 2.0在执行安装。你的意思是把这个MDAC_TYP.EXE文件不要,然后添加MDAC 2.6到打包文件列表里,是吗?好,我试试。
      

  4.   

    你可以先拿下载到的 MDAC_TYP.EXE 找一台机器安装试试,运行原先的程序是否还报错。
      

  5.   

    我把2.6的mdac_typ.exe替换了原来2.0的mdac_typ.exe,打包,安装,故障依旧,唉,顽疾了。而且,没有像2.0那样弹出microsoft data access component 2.0安装界面,只是显示:正在安装数据访问不见,然后就继续后面的文件安装了。我也按照楼上Tiger兄的方法,程序安装后,我又单独安装了一次mdac 2.6,还是报错,顽疾啊!!怎么办?!
      

  6.   

    用vb自带的打包工具做的安装,那些dll,ocx,tlb不用我一个个再去注册了吧?
      

  7.   

    在64位Windows下:
    64位exe和dll在目录c:\windows\system32目录下;
    32位exe和dll在目录c:\windows\syswow64目录下;
    所以要注意:
        在win64位系统下注册32位ocx或dll需要将32位ocx或dll拷贝到c:\windows\syswow64\目录下。
        且注册要用c:\windows\syswow64\regsvr32 xxxxxxx.ocx或dll
    设置32位DSN要用c:\windows\syswow64\odbcad32.exe
    设置32位alias要用c:\windows\syswow64\cliconfg.exe
      

  8.   

    你引用 2.8 版的试试。定位: C:\Program Files \Common Files\Sysem\ADO\msado15.dll
      

  9.   

    这是微软的说明:Referencing the ADO Libraries In a Visual Basic 6 Application
    To import the ADO libraries into a Microsoft Visual Basic 6 application, you must set a reference in the Visual 
    Basic project.To set a reference to the ADO libraries in a Visual Basic project
    1.Create a new or open an existing Visual Basic project.2.Click the Project menu item and then select References... from the drop-down menu panel.3.From Available References, check the box for Microsoft ActiveX Data Objects n.n Library, where n.n 
    represents the latest version number. The Location field below should identify your choice as 
    $installDir\msado15.dll, where $installDir represents the path of the directory in which the ADO 
    library has been installed.4.If you intend to use ADO MD, repeat step 3 to select Microsoft ActiveX Data Objects (Multi-dimensional) 
    n.n Library. The Location field should identify this choice as $installDir\msadomd.dll.5.If you intend to use ADOX, repeat step 3 to select Microsoft ADO Ext. n.n for DDL and Security. 
    The Location field should identify this choice as $installDir\msadox.dll.6.Click OK to finish setting the references.Backward Compatibility
    --------------------------------------------------------------------------------Installing ADO also copies the following type libraries of earlier versions:•msado27.tlb, ADO 2.7 Type Library•msado26.tlb, ADO 2.6 Type Library•msado25.tlb, ADO 2.5 Type Library•msado21.tlb, ADO 2.1 Type Library•msado20.tlb, ADO 2.0 Type LibraryIf your application must use any of these ADO libraries for reasons of backward compatibility, you need to 
    import the appropriate version of the type library. To do this, follow the procedures in the previous section, 
    replacing msado15.dll by msadoXX.tlb, where XX represents the version number you need to import.
    [/code]
      

  10.   

    .tlb 只是接口定义,供开发时使用,运行时用不上。
    兼容的最新版本的确是 2.8,安装时记得关闭杀毒软件。安装完后可以通过注册表确认一下:
    HKEY_CLASSES_ROOT\ADODB.Connection\CLSID\ 的默认值是 {00000514-0000-0010-8000-00AA006D2EA4};
    然后定位 HKEY_CLASSES_ROOT\CLSID\{00000514-0000-0010-8000-00AA006D2EA4}\,
    可以看到 ProgID\ 是 ADODB.Connection.2.8,
    InprocServer32\ 下有 msado15.dll 的全路径,确认路径是否正确?确认该文件是否存在?
      

  11.   

    2.8的试了,但是编译时,碰到 Dim MyRs As New Recordset 行时,显示“无效使用New关键字”。我把New去掉,但是在碰到 Set MyRs =MyDataEnv.MyDeConn.Execute("select * from person") 时出现: 实时错误'13':类型不匹配
      

  12.   

    我把 Dim MyRs As New Recordset 改为了2行:
    Dim MyRs As ADOB.Recordset 
    set MyRs=New ADOB.Recordset 
    编译通过,打包安装测试,还在努力中。这程序的源码是上一个程序员留下来的,也不知道他当初是怎么打包的
      

  13.   

    mdac_typ2.8已经是XP的一部分,所以我打包的时候,mdac_typ.exe应该在文件清单里不勾选,是吗?
      

  14.   

    在报错的机器上单独安装MDAC2.8MDACTYP.EXE试试
      

  15.   

    单独安装mdac_typ2.8,显示已经是XP的一部分,装不上的
      

  16.   

    是在目标机上安装MDAC_TYP2.8,显示: 
      

  17.   

    我另外找了一个2.8 for xp sp3 ghost 的在目标机上安装了,看到注册表里也有Tiger兄所说的2.8和那个15文件的全路径,说明mdac_typ2.8安装成功了,但运行程序的时候,依然显示:类不支持自动化或不支持期望的接口,真是想哭了
      

  18.   

    在project->references 和 project->components 里面找出所有被你引用的控件和库文件,除了msvbvm60.dll stdole2.tlb vbolb.olb以外的所有文件复制到目标机器windows->system32目录下,然后使用regsvr32.exe 依次对这些文件进行注册,如果你引用了ado,可以不用处理ado对应的库文件而改为安装对应版本的mdac_typ不要太相信打包工具,你的这种问题很可能就是有程序安装包制作不正确,在卸载的时候删除或者是unregister了某些库文件艹成的,特别是unregister
      

  19.   

    用CreateObject 试试呢,因为很多时候我发现用这个方法可以避开版本不兼容问题,用New不行,但是用CreateObject就可以。
    Set MyConn =CreateObject("ADODB.Connection")
      

  20.   

    问题解决了,我把程序拷贝到另一台电脑上,引用2.8,其他的都没有改,只是打包文件列表里还是用到的mdac_typ2.0,在安装时候可以看到是安装2.0(这一点不太明白)。反正是可以正常打包,正常安装和正常使用了,也许这台电脑的环境有点不一样吧,谢谢Tiger_Zhao等人的热心帮助!!
      

  21.   


    你看下Microsoft Visual Studio\VB98\Wizards\PDWizard\Redist 目录下的MDAC_TYP.EXE文件是什么版本的,打包文件中的mdac_typ.exe默认就来源于这个文件