Re: Checking state of Sql Server without permission

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Pedro (pnmm_at_portugalmail.pt)
Date: 09/22/04


Date: 22 Sep 2004 11:36:19 -0700

Hi all;

I managed to solve my problem. In fact, i'm using SQLDMO.LoginSecure =
true, so Windows Authentication let me know how's my Remote SqlServer
state or status.

What was only missing is something like this;

 Dim Server As New SQLDMO.SQLServer

 Server.Name = tsServerName
 Server.LoginSecure = True
 'Below, it's what was missing!!!!! Duh!
 Server.Connect(tsServerName)
 'End of what was missing!!!!! Duh again!

 If Server.Status = SQLDMO.SQLDMO_SVCSTATUS_TYPE.SQLDMOSvc_Running
Then
    'Do something
 End If
 
Thanks anyway!

pnmm@portugalmail.pt (Pedro) wrote in message news:<9f72c57b.0409210111.4f2943b@posting.google.com>...
> Hi all;
>
> After performed some google search, i've found that SQLDMO is
> limitated when concerning to sql remote server. See the transcription
> bellow;
>
> "...Sorry I missed that, you can not get the status of the "service"
> remotely on Win98, since there is no service control manager on Win9x
> and the SQL Server
> process is not really a service in that sense, since the OS does not
> support
> services. One of the many downsides of Win9x.
>
> GertD@SQLDev.Net
>
> Please reply only to the newsgroups.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> You assume all risk for your use.
> Copyright © SQLDev.Net 1991-2002 All rights reserved. ..."
>
> I've heard also that's possible to check state of my sql server using
> some king of API's. Is that correct? Can someone point me to some
> sample using some API to check state of Sql Server without permissions
> or connections?
>
> Please help! I'm struggling with this for some time and i need to find
> a quick and reliable solution.
>
> Thanks in advance!
>
> pnmm@portugalmail.pt (Pedro) wrote in message news:<9f72c57b.0409170026.136aa5f@posting.google.com>...
> > Hi all;
> >
> > I would like to have some opinion on this;
> >
> > What is so ever the "best practice" to check sql server's state?
> >
> > SQLDMO or simply try to connect and handle possible errors? What are
> > the advantages and disadvantages of both?
> >
> > And by the way, if you read previous posts, any suggestion about
> > "SQLDMO - is it possible to check state of Sql Server, apparently
> > without permissions?" or "Can you help me out with some sample which
> > tryes to connect to the server and if not succeeded, handles that
> > error?" would be very useful!
> >
> > Thanks in advance!
> >
> >
> > pnmm@portugalmail.pt (Pedro) wrote in message news:<9f72c57b.0409150013.660a656d@posting.google.com>...
> > > Hi again;
> > >
> > > Seems to me there's no way to workaround this. I should have the
> > > permissions to check my server's state... I know that's possible to
> > > check it's state trying to connect to the server and catch the error
> > > handling. Can someone give me some sample code with possible "server
> > > state" errors when trying to connect? Anyway, i would prefer to use
> > > SQLDMO.
> > >
> > > By the way, comparing this two methods - using SQLDMO or simply try to
> > > connect and handling errors - which is the "best practice"?
> > >
> > > Any help would be appreciated!
> > >
> > > Thanks in advance!
> > >
> > > pnmm@portugalmail.pt (Pedro) wrote in message news:<9f72c57b.0409140112.29f230d9@posting.google.com>...
> > > > Hi Tibor;
> > > >
> > > > In fact, i've tryed checking the state of my sqlserver object. Indeed,
> > > > it seems i don't have permissions to do that - see the error that
> > > > occurs, reported in my first post - despite using windows
> > > > authentication. Is there some other way to workaround this problem, or
> > > > should i use another technique to check if my server is running?
> > > >
> > > > Thanks in advance!
> > > >
> > > > "Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.com> wrote in message news:<emOgJsamEHA.2096@TK2MSFTNGP15.phx.gbl>...
> > > > > Did you try the Status property of the SQLServer object? Worth a try, I'm not sure whether it will
> > > > > allow you to check without permissions...
> > > > >
> > > > > --
> > > > > Tibor Karaszi, SQL Server MVP
> > > > > http://www.karaszi.com/sqlserver/default.asp
> > > > > http://www.solidqualitylearning.com/
> > > > >
> > > > >
> > > > > "Pedro" <pnmm@portugalmail.pt> wrote in message
> > > > > news:9f72c57b.0409130141.30544ecc@posting.google.com...
> > > > > > Hi all;
> > > > > >
> > > > > > Hope someone has the rith answer for this;
> > > > > >
> > > > > > I have one windows app written in vb.net and i'm using SQLDMO to check
> > > > > > if my Sql Server is running. I don't have any troubles when connected
> > > > > > to my local DB (MSDE) for checking the state of Sql Server, but when i
> > > > > > try do it on my remote Sql Server, which also uses Windows
> > > > > > Authentication, i can't access to the object created as follows:
> > > > > >
> > > > > > ...
> > > > > > Dim Server As New SQLDMO.SQLServer
> > > > > >
> > > > > > Server.Name = "RemoteServer"
> > > > > > Server.LoginSecure = True
> > > > > > ...
> > > > > >
> > > > > > the error "Thread was being stopped" occurs on the
> > > > > > "Server.LoginSecure=true" line and when i debug my code, i check that
> > > > > > among others, Server.Status displays: "error: cannot obtain value". I
> > > > > > suppose this kind of error occurs probably because i don't have the
> > > > > > proper pemissions to access the Server object. I don't want to use any
> > > > > > Login/Password because Windows Authentication should validate any
> > > > > > attempt to connect to RemoteServer. What am i doing wrong? Logically,
> > > > > > i should have permissions, at least for checking server's state. Is it
> > > > > > possible to do with SQLDMO, or should i use instead one connection to
> > > > > > my server and catch the exception if any occurs?
> > > > > >
> > > > > > Thanks in advance.



Relevant Pages

  • Re: SQLDMO -> SQLSMO
    ... dass du auch einen SQL Server 2000 damit steuern kannst. ... Ich will aber nicht die Clienttools installieren, sondern nur das SQLSMO, ... SQLSMO verwenden kann um die Funktionen aus SQLDMO zu verwenden? ...
    (microsoft.public.de.fox)
  • Re: Error 21776: After creating new login
    ... EM uses SQLDMO and caches a lot of the information you see. ... another SQL Server session is not visible to the SQL-DMO session. ... > EXEC DATA0003.dbo.sp_addlogin 'test','pwd' ...
    (microsoft.public.sqlserver.security)
  • Re: >> DMO
    ... Alex, thanks for your response. ... specific purpose of referencing server instances and database collections. ... express on vista and I was not able to reference SQLDMO objects. ... it still works with SQL Server 2008. ...
    (microsoft.public.access.modulesdaovba)
  • Re: How do I shrink my logfile?
    ... You're right - I apologize for the duh. ... > did not know EVERYTHING about SQL Server. ... and that can happen during a restore if you are not ... > You can only change the physical file names of tempdb. ...
    (microsoft.public.sqlserver.server)
  • Re: SQLDMO und DTSPackage-Bibliotheken fehlen
    ... > Bibiliotheken SQLDMO und DTSPackage in der Verweisliste zur Verfügung ... SQLDMO und DTS vermutlich;-) ... solltest Du dabei die Verzeichnisstruktur wie bei der SQL Server ... Installation bebehalten, sonst gibts Ärger wenn ein MSDE oder Servicepack ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)