[freetds] ct_connect returns failure

James K. Lowden jklowden at freetds.org
Fri Nov 21 00:36:49 EST 2008


developer loke wrote:
> Hi. This is my first post. I am a novice in freetds programming, and am
> trying to connect to a Microsoft Server 2008. I am able to connect with
> tsql -Svirtual -Usa -Ddatabase -Ppass. I have set the environment
> variable TDSVER=8.0 . I am trying to use the included c code, but the
> return at the last line in the following code is 0. What am I doing
> wrong?

http://www.sybase.com/detail?id=1013159
http://www.sybase.com/content/1013159/db2ct.tar

That's a URL for "Sample Programs for the DB-Library to Client-Library
Migration Guide" and the associated ct-lib sample code.  Have a look at
ctfirst.c.  

I'm more of a db-lib guy myself.  It looks to me like you're not setting
up your error & message handlers.  

HTH.  

--jkl



More information about the FreeTDS mailing list