Cluster Failover -- Active Node?

Hello,

I have a basic VB program querying the table RtCSQsSummary to display realtime stats.

Part of the connection string in the program is...
"Data Source=IPCC1\CRSSQL"
...when server 1 is the active node.  When it fails over, I have to manually change the connection string to:
"Data Source=IPCC2\CRSSQL"

Is there a way to programatically determine which node is active?

Thanks,
Matt

Recommended Reading: