I'm looking for a way or method to get back the IP address of the "active" Network connection.

Sample:

code:
SELECT
CASE (SUBSTR(@IPADDRESS0,1,11)) = "177. 21.128"
$logsrv = "SERVER5"
$spserver = "SERVER4"
CASE (SUBSTR(@IPADDRESS0,1,7)) = "132.105"
$logsrv = "SERVER2"
$spserver = "SERVER2"
CASE (SUBSTR(@IPADDRESS0,1,7)) = "155. 6"
$logsrv = "SERVER3"
$spserver = "SERVER3"
CASE 1
$logsrv = "SERVER1"
$spserver = "unknown"
ENDSELECT

This will get me back the IP Address of the 0 interface but not the 1, 2, 3 etc...

Some systems may have other PCMCIA cards, or AOL, Dialup connections, or a dual nic card.

How can I detemine which card is active and get the IP address of that one and not just refer to the 0 one.

On some systems you get back the built in default IP for Windows 2000
169.254.101.152