Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLDMO in VB.Net

Status
Not open for further replies.

rb11291978

Programmer
Joined
Oct 5, 2004
Messages
4
Location
PH

'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
colNames = oSQLApp.ListAvailableSQLServers()
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.
 
Make sure you have all of the SQL Service Packs (and hot fixes) installed. I found this helped when some code that used DMO worked on my machine but not on a coworker. We appliedn the Service Packs and hotfixes and it then worked on his machine as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top