Posted by Alex on 06/21/06 15:55
Thanks Chris.
You pointed me in the right direction.
For reference this is how it worked (in VB6):
Dim oSQLServer As New SQLDMO.SQLServer
Set oSQLServer = New SQLDMO.SQLServer
oSQLServer.LoginSecure = True
oSQLServer.Connect "(local)"
strLocalName = oSQLServer.HostName
oSQLServer.Disconnect
Set oSQLServer = Nothing
cheers
Alex
Chris Cheney wrote:
> "Alex" <alex_seymour@lineone.net> wrote in
> news:1150813848.497464.171900@i40g2000cwc.googlegroups.com:
>
> >
> > Hi,
> >
> > I am new to the mysteries of SQLDMO.
> >
> > I have written a program whereby the user can select which SQL server
> > to connect to on the Network and this works fine.
> > I am using the SQLDMO.Application.ListAvailableSQLServers routine and
> > this works fine.
> >
> > However, the Server on the users machine appears as 'Local'
> >
> > I need to display the server name as the actual server name instead of
> > 'Local'
> >
> > Any ideas how to do this with SQLDMO.
>
> Create an instance of the SQLServer object. You then have the choice of the
> following properties:
>
> Name this will give you the "(local)" name
> HostName
> TrueName
> NetName
>
> See SQLDMO in Books Online, Objects/S/SQLServer
Navigation:
[Reply to this message]
|