• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Is there a way to check if thepartcular DB is started using Win APIs?

I need to  check if the partcular DB is started using VC++> and the database that i have created is in SQL  Server 2005.
Please help with the code.

Thanks in advance.
0
madhav_119
Asked:
madhav_119
  • 3
  • 2
1 Solution
 
BrandonGalderisiCommented:
Define "db is started"?  Do you mean the SQL Server engine or a particular database?
0
 
madhav_119Author Commented:
I guess starting SQL server engine includes starting all the databases also..It would be great if you can tell me the way to check both. SQL Server Engine (i think here you check if MSSQLSERVER service is started) and particular DB.

Thanks
0
 
BrandonGalderisiCommented:
Are you looking to test the connection to the local machine that you are running on, or a remote machine?
0
 
madhav_119Author Commented:
On both. Local and remote
0
 
BrandonGalderisiCommented:
Well I would say that the best way would be to test a connection to the DB, not to the service.

In your app, just create a connection test method that creates a connection to the server with a low connection timeout (like 5 seconds).
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now