December 11, 2002 at 9:55 pm
Hi,
I am trying to get a listing of the available servers (Using VB.Net):
Function listServers()
Dim oApp As SQLDMO.Application
Dim oNames As SQLDMO.NameList
oApp = New SQLDMO.Application()
oNames = oApp.ListAvailableSQLServers
Dim i As Integer
For i = 1 To oNames.Count
Me.cboServerName.Items.Add(oNames.Item(i))
Next
End Function
However I recieve the following error:
An unhandled exception of type 'System.InvalidCastException' occurred in PiMSTransactionUnlockTool.exe
Additional information: QueryInterface for interface SQLDMO.NameList failed.
Any thoughts on how to get this server listing?
December 16, 2002 at 8:00 am
This was removed by the editor as SPAM
December 16, 2002 at 10:37 am
Not getting an error when I run it. Which DMO library are you using?
Andy
December 16, 2002 at 11:39 am
I found this in help...
The ListAvailableSQLServers method is supported only for servers and workstations running Microsoft Windows NT® 4.0 and Microsoft Windows 2000.
However even running it on 2000 with SQL 2k, I had the same error you did. I know it worked on NT 4 as I used to do the same thing.
I didn't find a work around either. 🙁
Gary Johnson
DBA
Sr. DB Engineer
Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer
This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.
December 16, 2002 at 2:21 pm
Hi,
I now have it working.
I performed a Windows Update, rebooted, and then installed Service Pack Two for SQL Server Client tools. I am not sure exactly what step it was that actually "helped" though.
Funny thing though, when I run the app in Visual Studio, the servers are returned OK, but when I ran the app alone, it fails to return the servers I am actually after. When installed on a different PC, the server listing works. Is it always sooo...... un-reliable?
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply