ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:database:microsoft_sql_server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v5:database:microsoft_sql_server [2019/12/29 20:21] – [Description] mnewnhamv5:database:microsoft_sql_server [2022/11/15 02:13] (current) – [Common Connection Problems] mnewnham
Line 12: Line 12:
  
 More about the FreeTDS libraries [[http://www.freetds.org/|here]] More about the FreeTDS libraries [[http://www.freetds.org/|here]]
-==== SQL Server 2003 ==== +
-Connecting to SQL server 2003 creates a difficulty There is no support for native client connections, and the alternative method, using php_mssql.dll was removed in PHP 5.3. The only alternative is to use a generic ODBC driver that does not require the Microsoft Native Client libraries. +
-------------------------------------+
 ====== mssqlnative ====== ====== mssqlnative ======
 <WRAP right box round 300px> <WRAP right box round 300px>
Line 28: Line 26:
 [[v5:database:pdo#pdo_sqlsrv|PDO driver for SQL Server]]\\ [[v5:database:pdo#pdo_sqlsrv|PDO driver for SQL Server]]\\
 [[v5:database:odbc#odbc_mssql|ODBC driver for SQL Server]]\\ [[v5:database:odbc#odbc_mssql|ODBC driver for SQL Server]]\\
 +== See Also ==
 +[[v5:reference:connection:setconnectionparameter#sqlserver|setConnectionParameter()]]
 </WRAP> </WRAP>
  
Line 74: Line 74:
 $db->connect('SERVER\SQLEXPRESS',NULL,NULL,'NORTHWND'); $db->connect('SERVER\SQLEXPRESS',NULL,NULL,'NORTHWND');
 </code> </code>
 +
 +===== Common Connection Problems =====
 +Recent versions of SQL Server fail to connect with an error ''Message: [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: The certificate chain was issued by an authority that is not trusted.''
 +
 +This problem can be resolved by adding
 +
 +<code php>
 +$db->setConnectionParameter('TrustServerCertificate',1);
 +</code>
 +
 +before issuing the ''$db->connect()'' statement
 +
 +
 ------------------------------ ------------------------------
 ===== How to create a connection under Linux ===== ===== How to create a connection under Linux =====
Line 116: Line 129:
 This driver provides access to Microsoft SQL Server databases from unix systems via Freetds This driver provides access to Microsoft SQL Server databases from unix systems via Freetds
  
-{{tag>[SQL_Server unix active freetds]}}+{{tag>[SQL_Server unix active freetds tier1]}}
 -------------------------------------- --------------------------------------
 ===== mssql (Windows) ===== ===== mssql (Windows) =====
v5/database/microsoft_sql_server.1577647269.txt.gz · Last modified: 2019/12/29 20:21 by mnewnham