This method of the Command class determines whether the connection is closed or open.
public com.ms.wfc.data.Connection getActiveConnection();
Returns a string containing a definition for a connection if the connection is closed, or a VARIANT containing the current Connection object if the connection is open.