[英]PHP 7 x64 ODBC Error Connecting to MSSQL Database
Getting the following error when testing an upgrade to PHP7 x64: 测试升级到PHP7 x64时出现以下错误:
odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified odbc_connect():SQL错误:[Microsoft] [ODBC驱动程序管理器]找不到数据源名称,并且未指定默认驱动程序
I've installed the following: 我安装了以下内容:
I have uncommented/added the following lines of my phpini: 我已经取消注释/添加了以下我的phpini行:
Things to consider: 需要考虑的事项:
Can't seem to find the answer anywhere else. 似乎无法在其他任何地方找到答案。 Any help would be appreciated.
任何帮助,将不胜感激。 Thanks.
谢谢。
I seem to have solved my own issue. 我好像已经解决了自己的问题。
Turns out, the ODBC_CONNECT string uses an explicit DSN name and not a database, apparently... 事实证明,ODBC_CONNECT字符串使用显式DSN名称而不是数据库,显然......
Previously my ODBC Connect string was $conn = odbc_connect('DB',$DBUSER, $DBPASS) and my ODBC Data Source was "SERVERNAME" 以前我的ODBC Connect字符串是$ conn = odbc_connect('DB',$ DBUSER,$ DBPASS),我的ODBC数据源是“SERVERNAME”
Once I changed the ODBC Data Source name to match the DB name, it worked. 一旦我更改了ODBC数据源名称以匹配数据库名称,它就可以工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.