I've used code from MSKB Article - Q287737
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q287737&
However I receive this error "QueryInterface for interface SQLDMO.NameList
failed."
Does anyone know what the cause of, and solution to this error is?
I'm using VB.NET & I've referenced the Microsoft SQLDMO Object Library.
Code from KB follows...
---------------------------------------------
Private Sub Command1_Click()
Dim i As Integer
Dim oNames As SQLDMO.NameList
Dim oSQLApp As SQLDMO.Application
Set oSQLApp = New SQLDMO.Application
Set oNames = oSQLApp.ListAvailableSQLServers()
List1.Clear
For i = 1 To oNames.Count
List1.AddItem oNames.Item(i)
Next i
End Sub
-------------------------------------------------------------
Thanks
Harry
Your code is correct. However there is a documented issue with SQLDMO that
causes this error. You'll probably need to apply a service pack to your
installation of SQLDMO to get this to work. Look for SQL Server 2000 SP2.
Since SQL DMO runs on the client, you'll need to install the service pack on
any client where you want to code to run.
--------------------------------------------
Dan Haught, FMS Inc.
* Total .NET XRef: C# and VB.NET Code Cross Reference
* Total .NET Analyzer: C# and VB.NET Error, Standards, and Performance
Analysis
Download today at: www.fmsinc.com/dotnet
"Harry" <ha...@nospam.com> wrote in message
news:O#auWfwWCHA.1752@tkmsftngp10...
Regards
Harry
"Dan Haught" <dha...@NOSPAMfmsinc.com> wrote in message
news:uquwpRyWCHA.1164@tkmsftngp10...