[英]odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect
I am getting error我收到错误
odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect for Linux server odbc_connect(): SQL 错误: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect for Linux server
while executing following command to connect with sybase from PHP.在执行以下命令以从 PHP 连接 sybase 时。
$db = ADONewConnection('odbc');
$DSN = 'UID=username;PWD=password;EngineName=dbServiceName;AutoStop=No;Integrated=No;Debug=No;DisableMultiRowFetch=No;CommLinks=SharedMemory,TCPIP{};Compress=No;Driver={Adaptive Server Anywhere 9.0}';
$db->Connect($DSN );
I have installed ODBC drivers with FreeTDS to connect Sybase database with PHP code with following commands我已经使用 FreeTDS 安装了 ODBC 驱动程序,以使用以下命令将 Sybase 数据库与 PHP 代码连接起来
/etc/odbc.ini file /etc/odbc.ini文件
freetds.conf file freetds.conf文件
[sybase]
host=
port=
Tds version=
If you're using FreeTDS, you need to specify the driver from odbcinst.ini
, which is normally FreeTDS.如果您使用的是 FreeTDS,则需要从odbcinst.ini
指定驱动程序,通常是 FreeTDS。 Try:尝试:
$DSN = 'UID=username;PWD=password;EngineName=dbServiceName;AutoStop=No;Integrated=No;Debug=No;DisableMultiRowFetch=No;CommLinks=SharedMemory,TCPIP{};Compress=No;Driver={FreeTDS}';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.