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 revisionBoth sides next revision
v5:database:microsoft_sql_server [2018/07/08 01:08] – [mssqlnative] mnewnhamv5:database:microsoft_sql_server [2018/07/08 01:24] mnewnham
Line 75: Line 75:
 </code> </code>
 ------------------------------ ------------------------------
 +===== How to create a connection under Linux =====
 +Establishing a connection to a SQL server database from a Linux client can be difficult, but by installing the freetds tools as well as the Microsoft ones provides a highly useful tool, //**tsql**//
 +
 +In the example, our database is running on a server 192.168.0.65:
 +<code>
 +# tsql -LH 192.168.0.65
 +    ServerName STUDY
 +   InstanceName SQLEXPRESS
 +    IsClustered No
 +        Version 12.0.2000.8
 +            tcp 55644
 +             np \\STUDY\pipe\MSSQL$SQLEXPRESS\sql\query
 +</code>
 +The response from the command tells us the
 +  * The SQL server instance is visible from the client
 +  * the service is running on port 55644
 +
 +We can now create a connection string:
 +
 +<code php>
 +$db = ADONewConnection('mssqlnative');
 +$db->connect('192.168.0.65,55644',$user,$pass,'NORTHWND');
 +</code>
 +--------------------------------------
  
 ===== mssql (Unix) ===== ===== mssql (Unix) =====
Line 89: Line 113:
 [[v5:database:pdo#pdo_mssql|PDO driver for FreeTDS]] [[v5:database:pdo#pdo_mssql|PDO driver for FreeTDS]]
 </WRAP> </WRAP>
-**This is the preferred driver for connecting to a SQL server database from Linux/Unix clients.**+**This is the preferred driver for connecting to a SQL server database from Linux/Unix clients, when the PHP version is less than 7.0**
 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
  
Line 136: Line 160:
 ^ADOdb V6|Yes| ^ADOdb V6|Yes|
 </WRAP> </WRAP>
-This driver appears to provide Unicode enhancements to the mssql driver+This driver appears to provide Unicode enhancements to the mssql driver. You can set character sets using the [[v5:reference:connection:setconnectionparameter|setConnectionParameter()]] command
  
 {{tag>["Microsoft SQL Server" unicode freetds windows]}} {{tag>["Microsoft SQL Server" unicode freetds windows]}}
v5/database/microsoft_sql_server.txt · Last modified: 2022/11/15 02:13 by mnewnham