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
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.