Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 SQLDMO in VBNet 2002

Author  Topic 

reyboy
Starting Member

12 Posts

Posted - 2004-10-05 : 22:00:46
'Use the SQL DMO Application Object to find the available SQL Servers
Try
Dim i As Integer
Dim oSQLApp As SQLDMO.Application
oSQLApp = New SQLDMO.Application()
Dim colNames As SQLDMO.NameList
'''Error in Here
colNames = oSQLApp.ListAvailableSQLServers()
'''Error in Here

For i = 1 To colNames.Count
cboServer.Items.Add(colNames(i)
Next i

Catch err As Exception
MsgBox(err.Message)
End Try

I got this Error
QueryInterface for interface SQLDMO.NameList failed.

Any problem with code or SQLDMO it self not 100% compatible to VBNet.

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-10-06 : 00:03:22
Look at this - Hopefully it will help:

http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=261757

or else - Google it.


Duane.
Go to Top of Page

reyboy
Starting Member

12 Posts

Posted - 2004-10-07 : 05:21:44
Thanks Duane, still It had my problem hanging.

QueryInterface for interface SQLDMO.NameList failed
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2004-10-07 : 07:25:56
What versions of things are you using ?

I just put your code into a project and it worked fine. I used VS.NET 2003 and SQL 2000 Developer edition (SQLDMO 8.0).

Damian
Go to Top of Page

reyboy
Starting Member

12 Posts

Posted - 2004-10-07 : 21:05:28
VBNet 2002 SP2, SQL 2000 Personal edition (2000.80.194.0 According to its property)
Go to Top of Page

reyboy
Starting Member

12 Posts

Posted - 2004-10-07 : 21:09:33
I dont think Microsoft made different versions of SQLDMO.dll for different types of SQL Servers but i'll try changing to Standard version if it will make any difference. But maybe its with my front end, VBNet Std. 2002 SP2
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2004-10-07 : 21:29:12
No DMO is the same among the SQL editions.
Sorry, I didn't notice you already said you were using VS 2002.
There may be an interop bug in 2002, I don't have a .NET 1.0 machine to test on, but I have used DMO with .NET 1.0 in the past.

I just did a little googling, update your SQL Server to sp3 (you should do that anyway), looks like a bug inside DMO that is fixed now.


Damian
Go to Top of Page
   

- Advertisement -