Pervasive SQL
Moderators: egami, macek, gesf
I'm using the following connection string to connect to the "P000Lap" Pervasive database from within MS Access
(See screenshot)
tdfLinked.Connect = "ODBC;DSN=P000Lap;DBQ=P000Lap"
However I would like to connect to it from PhP.
At the moment I'm connecting to a MySQL database from PhP but would also like to connect to the above.
$mysqli = mysqli_connect($databaseHost, $databaseUsername, $databasePassword, $databaseName);
How do I change the connection string for this.
If for whatever reason it is not possible, then how do I connect to the "PSQL" database in the screenshot - which is an Access db
Thanks a lot
Among other this is the code I tested just now but not working:
I also included a screenshot of the Pervasive Drivers installed. I'm running Win7 64
Code: Select all
<?php
$connect=odbc_connect("Driver={Pervasive ODBC Interface};ServerName=localhost;ServerDSN=P000Lap;","", "", SQL_CUR_USE_ODBC);
//$connect=odbc_connect("Driver={Pervasive ODBC Engine Interface};ServerName=localhost;ServerDSN=P000Lap;","", "", SQL_CUR_USE_ODBC);
$res = mysqli_fetch_array(mysqli_query($connect, "SELECT * FROM HRDepartments"));
$Descript = Trim($res['Description']);
echo $Descript;
?>