编辑:说三道四文库 发布时间:2018-04-27 04:54
HTML文档下载
WORD文档下载
PDF文档下载
我已引用了SQLDMO.DLL但在运行下面代码时提示:接口 SQLDMO.NameList 的 QueryInterface 失败.
try
{
//get all available SQL Servers
sqlServers = sqlApp.ListAvailableSQLServers();
for(int i=0;i<sqlServers.Count;i++)
{
object srv = sqlServers.Item( i + 1);
if(srv != null)
{
this.cboServers.Items.Add(srv);
}
}
if(this.cboServers.Items.Count > 0)
this.cboServers.SelectedIndex = 0;
else
this.cboServers.Text = "<No available SQL Servers>";
}
catch(Exception err)
{
MessageBox.Show(err.Message,"Error");
}
If you are using SQL Server 2000. Check your version by starting SQL Query Analyzer and running
SELECT @@VERSION
If it is lower than 8.00.534, then you need to install service pack 2. SP2 is at
http://www.microsoft.com/sql/downloads/2000/sp2.asp