程序是NT service,在启动时,读取数据库,windows2000下正常,
但是Windows2003 server上,经常出现服务起不来的情况。trace了一下,
发现由于ODBC函数30秒未返回,造成service启动失败。请问,ODBC和Windows2003 server不兼容吗?有什么解决方法吗?

解决方案 »

  1.   

    在程序里设置ConnetionTimeOut为 0 就是吧!
      

  2.   

    hoho 如何设置超时值?
    _ConnectionPtr m_pConnection;
    m_pConnection.CreateInstance("ADODB.Connection");
    m_pConnection.ConnectionTimeOut=0;
      

  3.   

    to  farawayzheng_necas(遥远)ConnectionTimeout缺省就是30
      

  4.   

    你用odbc链接什么数据库?如果链接oracle,一定要使用安装oracle客户端后由oracle提供的odbc驱动,windows的不稳定。
      

  5.   

    我连接的是MSDE,用的是SQL Server的driver,这样不行吗?ConnectionTimeout缺省就是30??SQL_ATTR_CONNECTION_TIMEOUT
    (ODBC 3.0) An SQLUINTEGER value corresponding to the number of seconds to wait for any request on the connection to complete before returning to the application. The driver should return SQLSTATE HYT00 (Timeout expired) anytime that it is possible to time out in a situation not associated with query execution or login. 
    If ValuePtr is equal to 0 (the default), there is no timeout.
                            ……………………
                            为什么这里说缺省是0呢?
      

  6.   

    i don't known the reason,but i do see on my book the connectiontimeout is 30,
    but i suggest you to have a try