`

FreeTDS: db-lib: exiting because client error handler returned 0 for msgno 20009

阅读更多

Hi James, ikorot

Sorry to replay now, I've take some days-off :-)..

My applications is working fine now. What I did was just compile wiht
enable-msdblib=yes and change my code to use the freetds.conf file.

Thanks for the answers.

Ps. I have one more question. I have to bind a int64 (long) data, and
looking through the headers files, I can't find something like
"DBINT64".
I've looked at tds_sysdep_public.h file and i found this:

#define tds_sysdep_int64_type long

but in the sybdb.h file, there is no typedef for this, only

typedef tds_sysdep_int32_type DBINT;

So my question is: Can I put this typedef tds_sysdep_int64_type
DBINT64 in the sybdb.h? or use the SYBINT8 type??

Best regards,
Fernando

That's what FreeTDS does
if it was compiled with enable-msdblib=no (the default case).

On Tue, Jan 5, 2010 at 11:30 PM,  <ikorot at earthlink.net> wrote:
> James,
> Thank you, Mr. core-dev for the nice explanation.
> That would've been my next step - offer to produce TDSDUMP.
>
>
> -----Original Message-----
>>From: "James K. Lowden" <jklowden at freetds.org>
>>Sent: Jan 5, 2010 8:07 PM
>>To: FreeTDS Development Group <freetds at lists.ibiblio.org>
>>Subject: Re: [freetds] Problem with connection.
>>
>>Fernando wrote:
>>> When the app call
>>> it, the function return an error and the message: "FreeTDS: db-lib:
>>> exiting because client error handler returned 0 for msgno 20009".
>>>
>>> Does anyone knows what this error message mean??
>>
>>It means the error handler returned 0, which is an instruction to the
>>library to call exit(3).
>>
>>$ grep -n INT_ include/sybdb.h
>>60:#define INT_EXIT     0
>>61:#define INT_CONTINUE 1
>>62:#define INT_CANCEL   2
>>63:#define INT_TIMEOUT  3
>>
>>> /* works fine until here, then I got the error here, not even enter in
>>> the if statement */
>>> if ((dbconn = dbopen(login, DBSERVER)) == NULL)
>>> {
>>>      fprintf(stderr, "ERROR! dbopen() page1.c.\n");
>>>      return FALSE;
>>> }
>>
>>Zero is INT_EXIT.  dbopen() never returns because when the handler returns
>>INT_EXIT, the library exits the program.
>>
>>http://manuals.sybase.com/onlinebooks/group-cnarc/cng1110e/dblib/@Generic__BookTextView/16561;pt=39614
>>
>>The default error handler, the one you get if you don't call
>>dberrhandle(), usually returns INT_CANCEL, cf. default_err_handler() and
>>dbperror() in dblib.c.  However, Sybase's specification, which FreeTDS
>>conforms to, says that the default handler "will abort the program if the
>>error has made the affected DBPROCESS unusable".  That's what FreeTDS does
>>if it was compiled with enable-msdblib=no (the default case).
>>
>>See also
>>http://www.freetds.org/userguide/samplecode.htm#SAMPLECODE.ERRORS.
>>
>>In your case, dbopen() failed to connect to the server.  It would return a
>>DBPROCESS of NULL, which would be unusable and for which DBDEAD() would
>>return true.  The default handler detects this, returns INT_EXIT, and the
>>library duly quits.
>>The internal function dbperror() produces the message.  I feel if the
>>*library* is going to quit, it should write something to standard error.
>>
>>(I could be convinced to change FreeTDS to deviate from Sybase's
>>specification in this case.  I've always thought it was weird that
>>db-lib's default behavior is to print *nothing*.  But I wouldn't do it
>>lightly.)
>>
>>The message 20009 is SYBECONN, meaning you couldn't connect to the server:
>>
>>
>>$ grep 20009 include/sybdb.h
>>#define SYBECONN        20009   /* Unable to connect socket -- SQL Server
>>#is unavailable or does not exist. */
>>
>>A TDSDUMP log may help sorting out why not.
>>
>>HTH.
>>
>>--jkl
>>
>>_______________________________________________
>>FreeTDS mailing list
>>FreeTDS at lists.ibiblio.org
>>http://lists.ibiblio.org/mailman/listinfo/freetds
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>

分享到:
评论

相关推荐

    freetds-devel-0.91-12.git0a42888.el7.x86_64.rpm

    离线安装包,亲测可用

    tiny_tds:TinyTDS-使用DB-Library的Ruby的简单,快速FreeTDS绑定

    TinyTDS-使用DB-Library对Ruby进行简单,快速的FreeTDS绑定。 -TravisCI -传送带 -宝石版 -社区 关于TinyTDS TinyTDS gem旨在满足使用FreeTDS的DB-Library API将结果从Ruby连接,查询和迭代到Microsoft SQL ...

    freetds-0.60.tgz_FreeTDS_freetds-0.63nb4.tgz_tds_analysis.rar

    标题中的"freetds-0.60.tgz"和"freetds-0.63nb4.tgz"代表了两个不同版本的FreeTDS源代码包,分别是0.60和0.63nb4版本。"tds_analysis.rar"可能是一个包含对TDS(Tabular Data Stream)协议分析或测试工具的压缩文件...

    FreeTDS-0.95版

    FreeTDS最新版本支持SqlServer2008,注意网上的FreeTDS0.91不支持--with-tdsver=7.1以上的SqlServer配置,也就是是说--with-SqlServer2005/2008在FreeTDS0.91下和2000是一样的驱动。

    freetds-current.tar.gz

    tar -zxvf freetds-patched.tar.gz cd freetds-dev.1.00.63 ./configure --prefix=/usr/local/freetds --with-tdsver=7.3 --enable-msdblib make && make install 安装:pdo_dblib 1.路径:cd /home/soft/...

    freetds-doc-0.91-12.git0a42888.el7.noarch.rpm

    离线安装包,亲测可用

    freetds-0.91v

    《freetds-0.91v:连接SQL Server与Symbian数据库的源代码库》 freetds-0.91v是一款专为Linux系统设计的开源软件,其主要功能是为开发者提供与Microsoft SQL Server和Symbian数据库进行交互的能力。这款软件的核心...

    freetds-0.91.tar.gz

    freetds-0.91.tar.gz 是FreeTDS的一个特定版本,即0.91版的源码包,通常通过这个压缩包,开发者可以在自己的环境中编译安装FreeTDS。 一、FreeTDS的核心功能 1. **跨平台支持**:FreeTDS的主要目标之一就是提供一...

    FreeTDS的应用及移植

    **FreeTDS应用及移植详解** FreeTDS是一款开源的软件库,主要用于在Unix和Linux系统上连接Microsoft SQL Server和Sybase数据库。它实现了TDS(Tabular Data Stream)协议,使得非Windows平台也能轻松地与这些数据库...

    freetds-0.91RC2.tar.gz

    《freetds-0.91RC2:跨平台连接SQL Server的开源模块》 freetds-0.91RC2是一款专为Linux、Unix和Windows操作系统设计的开源模块,其主要目的是为了提供与Microsoft SQL Server数据库的连接能力。这款软件在开源社区...

    freetds-1.1.tar.gz

    标题中的"freetds-1.1.tar.gz"是一个开源软件包,用于在Unix/Linux系统上与Microsoft SQL Server和Sybase数据库进行通信。Freetds是一个实现了TDS(Tabular Data Stream)协议的库,使非Windows平台上的应用程序能够...

    freetds:官方FreeTDS信息库

    FreeTDS 1.3.dev的自述文件(开发) 发行日期待定要构建FreeTDS,请阅读文件或 FreeTDS是Sybase DB-Library,CT-Library和ODBC库的免费实现。 FreeTDS可以在我们听说过的(以及一些我们还没有听说过的)各种类似Unix...

    FreeTDS 0.91

    它可以被用在Sybase的db-lib或者ct-lib库。它也包含一个ODBC的库。允许许多开源的应用软件比如Perl和PHP(或者你自己的c或C++程序)去连接到Sybase或 Microsoft SQL服务器。FreeTDS 以源码的形式被发布,几乎可以在...

    freetds最新的版本freetds-patched.tar.gz

    Freetds是一个开放源代码的软件包,它实现了Open Client Interface for SQL (ODBC)和Structured Query Language (SQL) Library (LibSQL)规范,使得非Microsoft操作系统,如Unix和Linux,可以与Microsoft的SQL Server...

    freetds-v0.95.95-win-x86-vs2015.zip

    这个压缩包“freetds-v0.95.95-win-x86-vs2015.zip”包含了适用于Windows 10 32位系统的FreeTDS版本,具体构建于Visual Studio 2015环境下。这个版本的发布旨在解决在某些地区下载速度慢的问题,特别是通过GitHub...

    freetds-1.00.27

    标题“freetds-1.00.27”指的是Freetds的一个特定版本,1.00.27,这是一个开源软件项目,旨在为Unix和类Unix系统提供与Microsoft SQL Server的连接能力。 描述中提到,“Linux下连接SQL Server的必备工具”,确认了...

    freetds的搭建

    进入解压后的目录,例如 `freetds-0.91`: ```bash cd freetds-0.91 ``` 然后配置安装选项,并执行编译和安装命令: ```bash ./configure --enable-msdblib --prefix=/usr/local/freetds make && make install ``...

    linux下freetds连接SQLserver2005的经典例子

    sudo apt-get install freetds-dev freetds-bin tdsodbc ``` 在CentOS或RHEL系统中,使用yum进行安装: ```bash sudo yum install freetds freetds-devel ``` 安装完成后,我们来看`sample.c`的代码示例,这是一...

    freetds-0.64.tar.gz

    《freetds-0.64:连接SQL Server与PostgreSQL的开源库》 freetds-0.64.tar.gz 是一个包含freetds 0.64版本源代码的压缩包,它是用于在Unix/Linux系统上实现与Microsoft SQL Server和Sybase数据库交互的开源库。这个...

    freetds-patched.tar.gz linux安装mssql扩展

    【标题】"freetds-patched.tar.gz"是FreetDS的一个补丁版本,用于在Linux系统上安装Microsoft SQL Server的扩展。FreetDS是一个开放源代码的库,它允许Unix和类Unix系统(包括Linux)与Microsoft SQL Server和Sybase...

Global site tag (gtag.js) - Google Analytics