5 pts.
 Ping SQL server in VB6.
I need to use VB6 to detect if an SQL server is running. Looking for the easiest way whether it is pinging or something else or even detecting the database itself. Preferably by network device name.

Software/Hardware used:
ASKED: December 19, 2004  2:55 PM
UPDATED: December 20, 2004  7:56 AM

Answer Wiki:
to detact sql server running u can do these steps 1. add refrence of microsoft sqlobject library 2. ListAvailableSQLServers properties gives u list of the server running
Last Wiki Answer Submitted:  December 20, 2004  12:42 am  by  Basant   0 pts.
All Answer Wiki Contributors:  Basant   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

It really depends on what you want to do, specifically. You can follow the above advice, then search within the returned results for your server’s name.

If you were so inclined, you could use the VB6 Winsock control to connect to the host box (assuming the SQL Server is set up to communicate via TCP/IP) on port 1433, IIRC. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingwinsockcontrol.asp for how to use the Winsock control. Doing something like this would allow you to tell if both server and SQL Server services were up, without having to query any databases just to get status.

 680 pts.