Re: INT_EXIT error returned for msgno 20009

"J.A." <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAEbQPJeB4rHFVcz_=4j27ZzCgv7qhX1nuOJOkn7uFzoM_3v2Gw@mail.gmail.com>
Thanks,

I haven't figured out how to build any of the unittests, in fact if I
could, I might just try using the connect.c to do this part for me.

How do I build t0001 ?  Also the bit you left at the bottom I don't quite
follow.  Sorry if these questions are rather basic!

Thanks for the help



On Mon, Oct 31, 2011 at 9:21 PM, James K. Lowden <[email protected]>wrote:

> On Mon, 31 Oct 2011 13:43:47 -0400
> "J.A." <[email protected]> wrote:
>
> > I'm using Gnu C to attempt to connect to a MS Sqlserver 2008
> > instance.  I have a freetds.conf file that successfully connects
> > using tsql.  I checked the log and it was not present.  This leads me
> > to believe the problem is my code is not using the config file (which
> > apparently works).
> >
> > how do I make my code use the config file?
>
> Your freetds.conf is not read by dbinit(); it's consulted when you
> call dbopen().
>
> > I am getting the following error when I run my code:
> > FreeTDS: db-lib: exiting because client error handler returned
> > INT_EXIT for msgno 2                  0009
>
> Oof, what a little whitespace can do to the meaning of a message!
> There is no msgno 2, which at first confused me.  But there is a msgno
> 20009:
>
> $ grep 20009 include/sybdb.h
> #define SYBECONN        20009   /* Unable to connect socket -- SQL
>                Server is unavailable or does not exist. */
>
> So I think your error stems from dbopen(), not dbinit().  If you
> install your error handler before calling dbopen() (as you should) you
> can choose *not* to return INT_EXIT.  For more information, look for
> the word "saith" in src/dblib/dblib.c.
>
> Try the same server with bsqldb or t0001.  These programs install an
> error handler and print a more useful message, e.g.:
>
> $ build/src/dblib/unittests/t0001 -S localhost
> found localhost.FreeTDS for jkl in "../../../PWD"
> About to logon as "jkl"
> About to open "localhost"
> DB-LIBRARY error (dberr 20009 (severity 9): "Unable to connect:
> Adaptive Server is unavailable or does not exist"; oserr 61:
> "Connection refused")
>
> HTH.
>
> --jkl
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.