VB6 - Know if MSSQLS is running, restart MSSQLS (...)
I was checking the forums for a way to find out if MSSQL Server was running and a way to know how to start MSSQL Server... Why? So I could start it if it was stopped.
As you can imagine, I didn't find any way at all, but I found a lot of questions about how to do it and none of them had an answer. So I took my time, found an approach to do it and now I would like to share it. Here is a list of what you can do with the module modSQLServerCmd:
1.- Know if MSSQL Server is running
2.- Start MSSQL Server
3.- Restart MSSQL Server
4.- Start MSSQL Server if MSSQL Server is not running
In the attached project you can find a status picture that gives you the sensation of using the Service Manager and an example of how to use some of the features listed before.
Yes, all of these functions will take some time to be executed... Why? Well, they all have to wait on the results and thus they depend on how long it takes MSSQL Server to respond.
Feel free to comment about it. If you have a better way to do this, please share it with all of us...
We miss you, friend... Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
Re: VB6 - Know if MSSQLS is running, restart MSSQLS (...)
It is nice to see people are taking a look at this code... You are welcome, nikhilj1.
If anyone else finds this code useful and would like to add points to my reputation, it would be nice. Don't feel obligated, though, helping someone else is always the best satisfaction one can get.
We miss you, friend... Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
Re: VB6 - Know if MSSQLS is running, restart MSSQLS (...)
I like the idea, but unfortunately it's a little crude... Why don't you do some Process Enumeration to check if the SQL Server Process is active and running?
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]