note 30554 deleted from function.odbc-connect by cmb
| From: | cmb@php.net | Date: | Sun, 25 Aug 2019 07:53:36 +0000 |
| Subject: | note 30554 deleted from function.odbc-connect by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211975@lists.php.net to get a copy of this message | ||
Note Submitter: Yvan Ecarri
----
I fighted with the "Data source name not found and no
default driver specified, SQL state IM002 in SQLConnect"
error for a while trying to connect via ODBC to a SQL Server
2000. Finally I found this workaround:
$cn = odbc_connect("Driver={SQL Server};Server=MyServer;Database=MyDatabase",
"MyUser","MyPassword")
Change "MyServer", "MyDatabase", "MyUser" and "MyPassword"
to the right values.
I guess that adding the "Integrated Security=YES" will work too.
Regards,
Yvan Ecarri, MCDBA, MCSD