PHP connection with DBISAM

1

For several days I have tried to connect to a DBISAM database but I have not managed it, download and install odbc driver and I do excel tests and it works perfect but when I try PHP it gives me an error, this is the script I'm using:

<?php  
$dsn = '"DRIVER={DBISAM 4 ODBC Driver}; ConnectionType=Local; CatalogName=C:/direccion donde estan las tablas;';
$user = '';
$password = '';

try {
    $dbh = new PDO($dsn, $user, $password);
    echo "conexion establecidad";
} catch (PDOException $e) {
    echo 'Connection failed: ' . $e->getMessage();
}
?>

this is the error that appears to me:

  

Connection failed: could not find driver

    
asked by alexander123 04.04.2016 в 23:26
source

1 answer

1

Assuming you have installed the driver correctly, try using odbc_exec() :

$db = odbc_connect("DRIVER={DBISAM 4 ODBC Driver};ConnectionType=Local;CatalogName=C:\[path catalogo];","admin","");

$res = odbc_exec($db,"SELECT * FROM [tabla]");
echo odbc_num_rows($res)." Registros!";

while($row = odbc_fetch_array($res)) {
    print_r($row);
}
    
answered by 05.04.2016 в 01:56