phpmysqldatabaseodbcsage-line-50

Sage 50 ODBC using PHP-SQL state IM002


I'm trying to set up an ODBC connection to connect to Sage. The DSN is set up and works via Access and Excel. However using the PHP code below,

I get "SQL state IM002" or "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"

$odbc['dsn'] = "SageLine50v19";
$odbc['user'] = "Peachtree";
$odbc['pass'] = "XXXXX";
$mysql['host'] = "localhost";
$mysql['user'] = "root";
$mysql['pass'] = "";
$mysql['dbname'] = "sagetest";
$mysql['idfield'] = "id";
$debug=true;

Thanks


Solution

  • Deleteing the USER data source name and define it as a SYSTEM data source name.

    Control Panel -> Administrative Tools ->Data Sources (ODBC): - User DSN : delete the specified User DSN - System DSN : create a new System DSN