> DECLARE Long WNetGetConnection in WIN32API; > STRING @lpzLocalName, ; > STRING @lpzRemoteName, LONG @lpnSize > > lcLocalName = "T:" > lcRemoteName = Space(255) > lnSize = 255 > > lnRet = WNetGetConnection( @lcLocalName, @lcRemoteName, @lnSize) > > * lnRet # 0 : not a mapped resource, or not connected, or other error >There are a couple of problems with WNetGetConnection(); first, it provides no mechanism to provide a user name and password to use to connect the resource, which means that it will always attempt to make the connection based on the user name and password (and by inference, domain) for your Windows login. The second is that it is officially listed as a legacy API call; this means that, at some point in the future, it may stop working on a new OS version, or may require you to run the app using it in a compatibility mode (it's officially a holdover from Win3.x)