Posted on 2005-04-26
I am trying, and thought I had been successful at, providing to my user a list of available SQL servers to choose from. The code below works fine on my machine but I have been unable to get it to execute anywhere else.
Dim i As Integer
Dim oNames As SQLDMO.NameList
Dim oSQLApp As SQLDMO.Application
'Retrieve the default User ID from the config file
txtUserID.Text = AppConfig.Key("DefaultUser")
oSQLApp = New SQLDMO.Application
oNames = oSQLApp.ListAvailableSQLServers()
For i = 1 To oNames.Count
'Add to ComboBox
This works like a charm on my development machine but throws an error everywhere else including other development machine which is as far as i can tell identical. The error it throws is "QueryInterface for interface SQLDMO.NameList failed". The only suggestion I can find is that I need to install SP2 for SQL Server but I already have SP3. I've insured that the .dll is in the app base directory.
I am offering 500 pts because this is really bugging me and I want to make sure it is good and thoroughly killed.