FreeTDS is an open source (or free software if you prefer) programming library, a re-implementation of the Tabular Data Stream protocol. It can be used in place of Sybase's db-lib or ct-lib libraries. It also includes an ODBC library. It allows many open source applications such as Perl and PHP (or your own C or C++ program) to connect to Sybase or Microsoft SQL Server.
FreeTDS User Guide
FreeTDS Reference Manual