0

I want to connect To SAGE commerciale 100 using odbc sage with php : I've succeeded to connect only with MS Excel. But with php I didn't

this my php code :

try
{
   $conn = odbc_connect("Driver=SAGE Gestion commerciale 
   100;Server=localhost;Database=GestCom_Sage100;","username","password");
}
catch (PDOException $e)
{
   echo $e->getMessage();
} 

But I got this error :

 SQL error: [Microsoft][Gestionnaire de pilotes ODBC] Source de données 
 introuvable et nom de pilote non spécifié, SQL state IM002 in SQLConnect.

if I use new pdo instead of odbc_connect i got the same error

 $conn = new PDO("odbc:GestCom_Sage100","username","password");

The error could be caused because am in windows 10 64 bits and I am using 32-bits odbc sage ?

kcrisman
  • 4,374
  • 20
  • 41
Sabra
  • 177
  • 2
  • 19

1 Answers1

0

I changed My code to :

$dsn = "GestCom_Sage100";
$conn = odbc_connect($dsn,"username","password");

And I execute my code on windows 7 32 bits and it worked. The problem was that ODBC sage is a 32 bits application used on 64 bits OS.

Sabra
  • 177
  • 2
  • 19