'// 创建 SQLDMO 的 Application 对象,用来取 SQL SERVER 名称
   Set objSQLDMO = CreateObject("SQLDMO.Application")
   Set objSQLServer = objSQLDMO.ListAvailableSQLServers
   intCount = objSQLServer.Count
   For i = 1 To intCount
      cboSource.AddItem objSQLServer(i)
   Next以上为函数部分代码;
目的是通过创建 SQLDMO 的 Application 对象,用来取 SQL SERVER 名称
并把结果列在下来列表框内,源码没有错误,(已经反复测试)
但有个更棘手的问题,如果本机安装了SQL SERVER则没有任何问题,
如果没有安装则没有任何显示,也不出错;
我在已经安装了SQL SERVER 的机器上查询出与SQLDMO相关的文件(例如: sqldmo.dll等)
拷贝到没有安装SQL SERVER 的机器上(c:\winnt\system32)也不行;
请问有没有哪位老师能执教一二;
多谢!!!

解决方案 »

  1.   

    Following is the list of SQL-DMO related DLLs that you need to enable DMO from a client: • Sqldmo.dll 
    • Sqldmo.rll 
    • Sqlsvc.dll 
    • Sqlsvc.rll 
    • Sqlwoa.dll 
    • Sqlresld.dll 
    • Sqlwid.dll 
    • W95scm.dll 
    From the preceding list of DLLs, the Sqldmo.dll is the only one that you need to register on the client computer. However, in order to successfully register the Sqldmo.dll file, the Sqldmo.rll file must be present on the client computer in the following directory: 
    (server side location): c:\Mssql7\Binn\Resources\1033
    (client side location): c:\Winnt\System32\Resources\1033 
    The Sqldmo.rll file always draws questions. An .rll file is a localized resource file. The resource directory varies based upon the national language configured on the SQL Server and client install. In this instance, directory 1033 is a decimal representation of the language identifier 0X0409, indicating U.S. English. After this .rll file is in place, you can register the Sqldmo.dll file by invoking the Regsvr32 utility.
      

  2.   

    hicksys(乡下人) 
    感谢您的回答,但还是没弄好,还是我没理解,您能再说清楚一点吗?