第一问,在官方网上freetds-current 与 freetds-stable 的区别? 即我应装哪一个?第二问 #> ./configure --prefix=/usr/local/freetds --with-tdsver=???这里是什么支持mssql 2005 --enable-msdblib第三问,当我按 tdsver =8.0 时,make & make install 后,用 ./tsql -Hip -p1433 -Usa -Ppd 时出错
 Unable to connect: Adaptive Server is unavailable or does not exist
  OS error 111, "Connection refused"
There was a problem connecting to the server
于是第四问: 打开freetds log 时发现
15:46:57.716610 4050 (iconv.c:394):tds_iconv_open: done
15:46:57.716692 4050 (net.c:205):Connecting to 192.168.0.5 port 1433 (TDS version 5.0)15:46:57.717455 4050 (net.c:270):tds_open_socket: connect(2) returned "Operation now in progress"
15:46:57.717800 4050 (net.c:306):getsockopt(2) reported: Connection refused
15:46:57.717848 4050 (net.c:316):tds_open_socket() failed
15:46:57
为啥 TDS version 为 5.0的呢? 我明明在编辑时,为8.0 的!这是为什么?

解决方案 »

  1.   

    我用的是stable版本的,0.91。 configure时用的命令是
    ./configure --prefix=/usr/local/freetds --with-tdsver=7.2 --enable-msdblib
    我看官方说7.2是支持2005的但是在 freetds.conf 中我配的是 tdsver = 8.0。 写7.2会出现报错。
    下面是我的 freetds.conf 里配置,我把它默认的都注释掉了。[global]
            # TDS protocol version
    ; tds version = 4.2 # Whether to write a TDSDUMP file for diagnostic purposes
    # (setting this to /tmp is insecure on a multi-user system)
    ; dump file = /tmp/freetds.log
    ; debug flags = 0xffff # Command and connection timeouts
    ; timeout = 10
    ; connect timeout = 10

    # If you get out-of-memory errors, it may mean that your client
    # is trying to allocate a huge buffer for a TEXT field.  
    # Try setting 'text size' to a more reasonable limit 
    text size = 64512
            client charset=utf8
    # A typical Sybase server
    #[egServer50]
    # host = symachine.domain.com
    # port = 5000
    # tds version = 5.0# A typical Microsoft server
    #[egServer70]
    # host = ntmachine.domain.com
    # port = 1433
    # tds version = 7.0[C3test-svr01]
            host = 10.86.168.10
            port = 1433
            tds version = 8.0你试试看。另求相关的C的开发代码,我刚开始搞这个。兄弟你如果精通的话,帮帮忙