Have you tried installing the correct version of ntwdblib.dll in c:\windows\system32?
This is the client library php needs and it is no longer supported by Microsoft. The dll that ships with php you cannot use, it does not work. There is a comment in the php manual, I think under mssql_connect that points to the url where you can download the correct dll.

Bart

Lorenz, Marcus schreef:
mssql Database Connection Problem

Hi everybody,

i have a problem connecting to a mssql server.

What i have done so far:

1. Installed MS SQL Server 2005 with advanced features (no named instance)
2. Added a new user
3. Check if user is able to connect to server withing management studio
4. Created a new database (owner is sa, granted access rights to new user to new database)
5. enabled named pipes
6. using both connection types (windows and server)
6.5. Changed the Database dialect from 7 to 8 to 9 and back
7. enabled php_pdo and php_pdo_mssql
8. Wrote this little part of code:

self::$db=Zend_DB::factory($CONFIG->environment->get(ENVIRONMENT)->databaseConnections->get($serveralias));
self::$db->getConnection();

Whereas xml structure is the following:

<datahub adapter="pdo_mssql">
      <!-- Name of the database,host and credentials -->
        <params host="127.0.0.1" port="1433" username="xxx" password="xxx" dbname="data-hub" />
</datahub>

9. Receving the following log entry from the database server:

2008-11-11 16:17:51.42 Logon       Login succeeded for user 'xxx'. Connection: non-trusted. [CLIENT: 127.0.0.1]

10. At the same time receving following Exception:

SQLSTATE[HY000] General SQL Server error: Check messages from the SQL Server. (severity 5)

This is the stacktrace:

[0] => Array
        (
        [file] => D:\Projekte\Unilever\Digital-Layer\src\library\Zend\Db\Adapter\Pdo\Mssql.php
            [line] => 134
            [function] => _connect
            [class] => Zend_Db_Adapter_Pdo_Abstract
            [type] => ->
            [args] => Array
                (
                  )
        )
[1] => Array
        (
                [file] => D:\Projekte\Unilever\Digital-Layer\src\library\Zend\Db\Adapter\Abstract.php
            [line] => 274
            [function] => _connect
            [class] => Zend_Db_Adapter_Pdo_Mssql
            [type] => ->
            [args] => Array
                (
                  )
        )
[2] => Array
        (
                [file] => D:\Projekte\Unilever\Digital-Layer\src\library\class\DBFactory.php
            [line] => 57
            [function] => getConnection
            [class] => Zend_Db_Adapter_Abstract
            [type] => ->
            [args] => Array
                (
                  )
        )

Has anyone an idea what is going wrong? I have no message in my logfile (no other than the one under point 9).

What looks strange to me is that the server replies ok, PHP says no.

Any help would be appriciated

Best regards

Marcus


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

--
Bart McLeod
Space Web Internet Team
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ [EMAIL PROTECTED]
www.spaceweb.nl
zce logo zce PHP 5 logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!

Reply via email to