我也郁闷,用adodb(PHP的那个类库)连 mssql2k,有一阵子很正常,然后会出现连不上服务器的提示(unable...)重启一下apache就好了。。找不到原因。。adodb是用mssql_pconnect连的。我现在改在iis下试试,看会不会出现这个问题。

解决方案 »

  1.   

    把php_mssql.dll从extension目录拷贝一份到c:\winnt\system32下
    重启动apache ok
      

  2.   

    记得把;php_mssql.dll
    改为php_mssql.dll,在 php.ini文件里
      

  3.   

    From http://cn.php.net/manual/zh/ref.mssql.php
    Requirements for WIn32 platforms. The extension requires the MS SQL Client Tools to be installed on the system where PHP is installed. The Client Tools can be installed from the MS SQL Server CD or by copying ntwdblib.dll from \winnt\system32 on the server to \winnt\system32 on the PHP box. Copying ntwdblib.dll will only provide access. Configuration of the client will require installation of all the tools. Requirements for Unix/Linux platforms. To use the MSSQL extension on Unix/Linux, you first need to build and install the FreeTDS library. Source code and installation instructions are available at the FreeTDS home page: http://www.freetds.org/ 安装
    The MSSQL extension is enabled by adding extension=php_mssql.dll to php.ini. To get these functions to work, you have to compile PHP with --with-mssql[=DIR], where DIR is the FreeTDS install prefix. And FreeTDS should be compiled using --enable-msdblib. 
      

  4.   

    楼上的老兄 你的英文我大致明白
    我的PHP.MASSQL.DLL已经成功加载了
    我觉得问题不在这里吧!
      

  5.   

    你的php版本?apache版本?操作系统?
      

  6.   

    操作系统WIN32 SERVER
    PHP Version 4.3.2
    Apache/1.3.24
      

  7.   

    直接连接和使用ODBC都出错了 莫名其妙的  我只想知道为什么出错 和正确的链接方法
      

  8.   

    加上一行,D:\為你PHP 放置的目錄
    extension_dir = D:\PHP\extensions
      

  9.   

    我的
    extension_dir="C:\PROGRA~1\Zend\lib\php_ext"
    改目录下也存在MASSQL.DLL这个文件!
    我的WEB发布目录在D:\PHP下!
      

  10.   

    老兄还是用ADO吧,php和mssql的兼容问题很多。
    $conn = new COM("ADODB.Connection") or die("Cannot start ADO");
    $conn->Open("driver={sql server};uid=sa;pwd=youpassword;server=servername;database=suntime");
    $rs=new com("adodb.recordset");
    $rs->open("select * from [table1]",$conn,3,3);    // Recordset$rsname=$rs->Fields("名称");
    for($i=0; $i<4; $i++)
    {
    // $rs->AddNew();
    echo $rsname->value ."<br>";
    $rs->movenext();
    // $rs->update();
    }
    $rs->Close();
    $conn->Close();$rs->Release();
    //$conn->Release();$rs = null;
    $conn = null;
      

  11.   

    我一直在用adodb,
    在项目中有很多都是连mssql,从没有出现过问题。
    只是有些时候配置php环境的时候,mssql.dll模块加载不上,但只要将其拷到系统根目录下就行了。一旦加载了mssql模块。就从来没有初选过问题了。
    我觉得adodb真是个好东东,兼容性太好了,非常稳定。
      

  12.   

    楼主 warning说该排序归则,你就该嘛,试试看,是不是在语言里该阿
      

  13.   

    在 php.ini 中把;extension=php_mssql.dll改为extension=php_mssql.dll
    把d:\php\dll文件内的*.dll复制到D:\PHP\extensions下
    在 php.ini 中把extension_dir = D:\PHP\extensions