Dino wrote on Wed, 10 Aug 2005 21:23:52 GMT:
> I am writing some code in VB.NET and need to pass an SQLServer object
> to a method. How do I do that? What is the type of SQLServer object?
You might want to try a different group, this one is for the Full Text
Service part of SQL Server. However, I'll give it a stab.
> I created it using :
> Dim oSQLServer = CreateObject("SQLDMO.SQLServer")
[quoted text clipped - 5 lines]
>
> How do I do this?
I would guess for the same reason it would fail in VB6 (which I'm still
programming in, so I'm not sure on the VB.Net differences) - you have no
reference to SQLDMO in the project. Either add a reference to it and then
change the first line to
Dim oSQLServer as New SQLDMO.SQLServer
(which then allows you to take advantage of early binding)
or change the Call line to
Call CreateFullTextCatalogs(byval oSQLServer as Object)
Not sure if either of these work in VB.Net, but that's what I'd use in VB6.
Dan
Dino Buljubasic - 11 Aug 2005 20:14 GMT
Thanks for your reply,
I am passing it as an Object type and it works fine. I don't know if
that is the best way to do it but so far it works.
Re. Adding reference to SQLDMO.SQLServer, I don't know how to do that.
I was trying to find what should I import in my code but was not
successful in that.
I appreciate your help
_dino_
>Dino wrote on Wed, 10 Aug 2005 21:23:52 GMT:
>
[quoted text clipped - 30 lines]
>
>Dan
Daniel Crichton - 15 Aug 2005 09:20 GMT
Dino wrote on Thu, 11 Aug 2005 19:14:26 GMT:
> Thanks for your reply,
> I am passing it as an Object type and it works fine. I don't know if
[quoted text clipped - 4 lines]
> successful in that.
> I appreciate your help
In VB6, to add a reference you would go to Tools > References, and then find
Microsoft SQLDMO Object Library in the list and tick it. Then you would
change your code to look like:
Dim oSQLServer as SQLDMO.SQLServer
Set oSQLServer = New SQLDMO.SQLServer
Call CreateFullTextCatalogs(ByVal oSQLServer as SQLDMO.SQLServer)
Hope this helps to find out how to make the change in VB.Net.
Dan