Page 1 of 1

Pervasive SQL

Posted: Sun Feb 09, 2020 11:17 pm
by YitzchakK
67217-1643c98702b825fbff57a7a139f70c7b.jpg
67217-1643c98702b825fbff57a7a139f70c7b.jpg (6 KiB) Viewed 2171 times
Hi all,

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

Re: Pervasive SQL

Posted: Sun Feb 09, 2020 11:54 pm
by YitzchakK
Among other this is the code I tested just now but not working:

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;
?>
I also included a screenshot of the Pervasive Drivers installed. I'm running Win7 64
Screenshot_x.jpg
Screenshot_x.jpg (9.15 KiB) Viewed 2168 times