php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74754 SQL Server Driver String Not Up to Date
Submitted: 2017-06-13 17:00 UTC Modified: 2017-06-29 00:20 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: henry at dotrose dot com Assigned:
Status: Open Package: ODBC related
PHP Version: 7.0.20 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: henry at dotrose dot com
New email:
PHP Version: OS:

 

 [2017-06-13 17:00 UTC] henry at dotrose dot com
Description:
------------
---
From manual page: http://www.php.net/function.odbc-connect
---
In the "Example #1 DSN-less connections" portion of the documentation, it says:

// Microsoft SQL Server using the SQL Native Client 10.0 ODBC Driver - allows connection to SQL 7, 2000, 2005 and 2008
$connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user, $password);

This does not work with recent installations of unixODBC. It returns a unixODBC error message saying Driver Manager "cannot open lib 'SQL Server Native Client 10.0' : file not found".

Rather than changing the Driver string, however, I suggest adding something that helps the user find the correct current value. By looking in /etc/odbcinst.ini, I was able to find the correct value for my installation, which is "ODBC Driver 13 for SQL Server". I don't know where the relevant string would be on a Windows or Mac system, but I suspect someone does.


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-29 00:20 UTC] cmb@php.net
-Package: Documentation problem +Package: ODBC related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC