把php_mssql.dll从extension目录拷贝一份到c:\winnt\system32下 重启动apache ok
记得把;php_mssql.dll 改为php_mssql.dll,在 php.ini文件里
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.
重启动apache ok
改为php_mssql.dll,在 php.ini文件里
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.
我的PHP.MASSQL.DLL已经成功加载了
我觉得问题不在这里吧!
PHP Version 4.3.2
Apache/1.3.24
extension_dir = D:\PHP\extensions
extension_dir="C:\PROGRA~1\Zend\lib\php_ext"
改目录下也存在MASSQL.DLL这个文件!
我的WEB发布目录在D:\PHP下!
$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;
在项目中有很多都是连mssql,从没有出现过问题。
只是有些时候配置php环境的时候,mssql.dll模块加载不上,但只要将其拷到系统根目录下就行了。一旦加载了mssql模块。就从来没有初选过问题了。
我觉得adodb真是个好东东,兼容性太好了,非常稳定。
把d:\php\dll文件内的*.dll复制到D:\PHP\extensions下
在 php.ini 中把extension_dir = D:\PHP\extensions