Page 1 of 1
PDO Problem
Posted: Thu Jul 06, 2006 12:03 pm
by Ree
When trying to access MS SQL DB using PDO, I get the following error:
SQLSTATE[HY000]: General error: 10007 Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. [10007] (severity 5) [SELECT * FROM Lessons]
How do I fix it?
Any help would be greatly appreciated.
Posted: Thu Jul 06, 2006 1:49 pm
by bdlang
Error seems to indicate the library PHP has used for the PDO extension is outdated. Are you using
PDO_ODBC or
PDO_DBLIB?
Quotes from the PHP manual section on PDO_DBLIB:
This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk.
...and more importantly...
On Windows, you should use the PDO_ODBC driver to connect to Microsoft SQL Server and Sybase databases, as the native Windows DB-LIB is ancient, thread un-safe and no longer supported by Microsoft.
Some additional information would help, I'm sure:
Is PHP on a Windows or UNIX server? What server version? What PHP version?
Is this on your own server or a hosting company? Have you contacted their tech support?
Have you been / are you successful in using the same SELECT statement by other methods other than PDO?
Please note I have never worked with this specific PDO driver nor have I ever worked with MS SQL, just trying to help.
Posted: Thu Jul 06, 2006 3:07 pm
by Ree
Thank you, I tried with ODBC, and the error disappeared, however, another problem now occurs which I posted
here.