I'm trying to access an ODBC connection in PHP via PDO_ODBC. This is my code:
$db = new PDO('odbc:MyDSN', '', '');
And I'm getting this error:
SQLSTATE[IM002] SQLConnect: 0 [Microsoft][ODBC Driver Manager] Data
source name not found and no default driver specified
I know the DSN is working because I can use it in Python with pyodbc. The type is User DSN - does it need to be a System DSN? I'm not specifying a driver because I figured ODBC was abstracting that away, but maybe I need to? The underlying DB is Oracle, if that helps.
Thank you!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…