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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
30 - 14 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

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: Thu Mar 28 15:01:29 2024 UTC