Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / August 2005

Tip: Looking for answers? Try searching our database.

How to pass an SQLServer object to a method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dino Buljubasic - 10 Aug 2005 22:23 GMT
Hi,

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?

I created it using :
Dim oSQLServer = CreateObject("SQLDMO.SQLServer")

and want to pass it to a method like:
Call CreateFullTextCatalogs(byval oSQLServer as SQLDMO.SQLServer)

but I get error:SQLDMO.SQLServer is not defined.

How do I do this?

Thank you,
DINO
Daniel Crichton - 11 Aug 2005 09:39 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.