Hi all,
Not sure if this would be better posted here or in one of the SQL groups,
but I'll try here first cause you guys are so smart :) I'm writing an app
that uses SQL-DMO to enumerate the SQL Servers on the net. Here's what the
code looks like:
private ArrayList getSqlServerList()
{
ArrayList a = new ArrayList();
SQLDMO.ApplicationClass sqlApplication = new SQLDMO.ApplicationClass();
SQLDMO.NameList ServerList = (SQLDMO.NameList)
sqlApplication.Application.ListAvailableSQLServers ();
for( int Counter = 0; Counter < ServerList.Count; Counter++ )
{
string ServerName = ServerList.Item( Counter );
if( ServerName != null && a.IndexOf( ServerName ) < 0 )
a.Add( ServerName );
}
return (a);
}
It runs fine on one machine, but on another it generates the following
error: "system.invalidcaseexception : queryinterface of sqldmo failed".
From what I could find the solution is to upgrade to the "latest service
pack" on the client(?), although they don't specify which one at the time
(SP2, SP3, SP3a?) Some are saying the Service Pack might have to be
installed multiple times? I ran the code above successfully on a SQL 2000
machine with SQL 2000 SP2, but it didn't work with SQL 2000 SP3?
I couldn't find anything on in the MS KB on this issue. The program with
this code in it is going out to a lot of people out there. Does anyone know
what's going on here or how I can fix it? Can you point me to an MS KB
article or two?
Thanks,
Michael C.