利用ODBC工具建立一个SQL的系统DSN时配置第一页有一个选项:您想连接到哪一个SQL Server?
下面是一个组合框,下拉时会出现可以访问到的所有SQL服务器?我想问样达到这个效果,即如何获得所有有访问的SQL Server列表?
下面是一个组合框,下拉时会出现可以访问到的所有SQL服务器?我想问样达到这个效果,即如何获得所有有访问的SQL Server列表?
解决方案 »
- 2008年07月22日 周二 高新技术企业IT、电子 在海淀分部举行
- 树的节点合并问题
- VC中使用CHtmlView,打开Url时,如何禁止状态栏显示正在打开的信息?
- 为什么 "扩展dll要求客户程序动态连接到mfc"?
- 菜单的子菜单不响应事件处理函数,怎么办?
- [求助]调试过程中出来个对话框,不知道什么意思
- 动态生成树控件消息映像问题
- 一个基于对话框的程序,出现unresolved external symbol _WinMain@16错误?
- 如何获取图像的大小?
- 如何使一个基于对话框的MFC程序在一开始运行时就是隐藏的
- 请问UNIX下的.z压缩文件是什么压缩算法?
- PostMessage怎么不行?
SQL-DMO::ApplicationPtr->ListAvailableSQLServers( ); // as NameList
二楼确实可用
但我还建议你用微软的SQL-DMO组件,他的代码更简单根直观,实际代码和我贴的差不多,
SQL-DMO::ApplicationPtr->ListAvailableSQLServers的返回值为一安全数组的变体形由于我现在手头的机器上没装SQL Server,所以给不出Sqldmo.dll的详细位置分,无所谓了
The following SQL-DMO files are included with the SQL Server 32-bit client tools for Windows 95 and Windows NT, which you must install to use SQL-DMO.In C:\SQL60\DLL
File Description
SQLOLE.HLP Help file containing reference information about SQL-DMO objects, properties, methods, lists, and collections.
SQLOLE.REG SQL-DMO Registry file.
SQLOLE32.DLL SQL-DMO in-process server and COM custom component.
SQLOLE32.TLB SQL-DMO type library, usually used by OLE Automation controllers like Visual Basic. In C:\SQL60\INSTALL
File Description
SQLOLE42.SQL Transact-SQL script to create SQL-DMO stored procedures for SQL Server 4.21 servers. You must install these on a SQL Server 4.21 server before SQL-DMO objects can connect to that server.
SQLOLE60.SQL Transact-SQL script to create SQL-DMO stored procedures for SQL Server 6.0 servers. These are already installed by SQL Server 6.0. In C:\SQL60\SQLOLE\INCLUDE
File Description
SQLOLE.H Header file for C++ programs containing function prototypes for SQL-DMO objects, properties, methods, lists, and collections.
SQLOLEID.H Header file for C++ programs containing class IDs and interface IDs for SQL-DMO. In C:\SQL60\SQLOLE\SAMPLES
File Description
README.TXT Summary of sample programs available in each directory.
Installing SQL-DMO
All required SQL-DMO components are installed as part of an instance of Microsoft® SQL Server™ server or client. SQL-DMO is implemented in a single dynamic-link library (DLL). You may develop SQL-DMO applications on either a client or a server. When using an OLE Automation controller as a development platform, such as Microsoft Visual Basic®, no additional files are required. Application development using C or C++ requires the SQL-DMO header files.SQL-DMO sample applications, providing additional reference material for SQL-DMO application development, are included with SQL Server.Directory File Description
C:\Program Files\Microsoft SQL Server\80\Tools\Binn Sqldmo.dll DLL implementing SQL-DMO objects.
C:\Program Files\Microsoft SQL Server\80\Tools\Binn Sqldmo80.hlp SQL-DMO help file used within the development environment to provide context sensitive help about SQL-DMO objects, properties and methods.
C:\Program Files\Microsoft SQL Server\80\Tools\BinnResources\xxxx Sqldmo.rll Localized resource file. The resource directory varies based on the national language of the instance of SQL Server client or server. For example, the directory 1033 is a decimal representation of the language identifier 0X0409, indicating English, U.S.
C:\Program Files\Microsoft SQL Server\80\ToolsDevtools\Include Sqldmo.h C/C++ header file containing SQL-DMO member function prototypes, enumerated data types, and macros.
C:\Program Files\Microsoft SQL Server\80\ToolsDevtools\Include Sqldmoid.h C/C++ header file containing SQL-DMO interface and class identifiers.
\Program Files\Microsoft SQL Server\MSSQL\Install Sqldmo.sql Transact-SQL script implementing stored procedures that support SQL-DMO. Available on SQL Server server-instance only.
C:\Program Files\Microsoft SQL Server\80\ToolsDevtools\Samples\Sqldmo ALL Sample applications illustrating SQL-DMO use.
To register the SQL-DMO components on a client computer From C:\Program Files\Microsoft SQL Server \80\Tools\Binn\Resources\<language> directory, execute:
\Program Files\Microsoft SQL Server \80\Tools\Binn\REGSVR32 SQLDMO.DLLFrom any directory, execute:
C:\Program Files\Microsoft SQL Server \80\Tools\Binn\REGSVR32.EXE C:\Program Files\Microsoft SQL Server \80\Tools\Binn\resources\1033\SQLDMO.RLL
See AlsoOverview of Installing SQL Server 2000©1988-2003 Microsoft Corporation. All Rights Reserved.