I have tried all of this (except the Apache thing, since I'm running the script from a terminal, it's not CGI). I also tried the 2.2.19 kernel, with no change. I had set the SYBASE variable in the profile, so it would be system wide.
I am wondering if I've missed some other requirement, like having SAMBA running, or possibly something running on the NT machine?