Page 1 of 1

class 'COM' not found in /opt/lampp/htdocs/

PostPosted: 16. March 2016 19:00
by gyver76370
Hi

My script extract data from a HFSQL database (WINDEV)

Code: Select all
<?php
// Déclaration de la chaîne de connexion
$ProviderOLEDBHyperFileSQL ='Provider=PCSOFT.HFSQL; Data Source=xxx.xxx.xxx.xx:yyyy; Initial Catalog=point8d; User ID=dddd; Password=sssss;';
 
// Instanciation de l'objet
$ConnectionOLEDBHyperFileSQL = new COM("ADODB.Connection") or die("Impossible d'instancier un objet ADO");
 
// Connexion
$ConnectionOLEDBHyperFileSQL ->ConnectionString = $ProviderOLEDBHyperFileSQL;
$ConnectionOLEDBHyperFileSQL ->Open();
 
// Création et exécution de la requête
$rs = new COM("ADODB.Recordset");
$sql = "SELECT id_point,quand,quoi FROM point where flag = 'OUVERT'";
$rs->Open($sql, $ProviderOLEDBHyperFileSQL);
 
// Parcours du résultat de la requête
$index = 0;
while (!$rs->EOF) {
 
for( $x = 0; $x < $rs->Fields->Count; $x++ )
{
 
$assoc_array[ $index ][ $rs->Fields[$x]->Name ] = $rs->Fields[$x]->Value;
echo $rs->Fields[$x]->Name ." -> ". $rs->Fields[$x]->Value . "<br>";
}
 
echo "--------------------------------------------<br>";
$rs->MoveNext();
$index++;
}
 
$rs->Close();
 
?>


with WAMP (windows 7) it is work well.

but with XAMPP PHP 5 (Debian 7) i have the following mistake

Code: Select all
Fatal error: Class 'COM' not found in /opt/lampp/htdocs/ouvert/all_point_ipp.php on line 6


Can you help me please ?

Thank for your help

BR

Re: class 'COM' not found in /opt/lampp/htdocs/

PostPosted: 16. March 2016 19:49
by Altrea
Hi,

Class COM is provided by a Microsoft .NET class. This is Windows only.

best wishes,
Altrea

Re: class 'COM' not found in /opt/lampp/htdocs/

PostPosted: 17. March 2016 08:54
by gyver76370
hi

ok thank it was that i see on internet , i wanted to be sure

now i have to search how to extract database HFSQL with PHP page

thank again bye