Pervasive Connection String

Freshman

Registered User.
Local time
Today, 20:40
Joined
May 21, 2010
Messages
437
Hi all,

I'm using the following connection string to connect to the "P000Lap" Pervasive database from within Access

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 (which is an Access db linking to the "P000Lap" tables.
So the result will be the same but with a "middleman" which I don't want.

See screenshot on the above

Thanks a lot
 

Attachments

  • Screenshot_2.jpg
    Screenshot_2.jpg
    32.6 KB · Views: 152
you can't use mysqli() or pdo() because those are specifically reserved for the PHP language in regards to communicating with MYSQL (as far as I know). the string "mysqli()" should say that, by definition alone. FYI => the "i" stands for "improved". what have you tried so far? if you *have* tried something, did PHP throw an error? the language's error specifications can be printed to a page by calling the phpinfo() function. PHP also keeps very good error logs, usually in a error log file located in the same directory where the error was encountered. more than likely you *can* do this, because most server languages and the companies that create them build in features that allow them to communicate with other peoples' software. Apple might be an exception to this, because Steve Jobs was so insanely obsessed with keeping his stuff internal and secret.

have you looked about yet? https://www.google.com/search?q=Pervasive+database+php+connect. the first result there takes you to S/O forum where answer #3 seems like it might be able to help you out. the other results on the page, based on the URL's preview text, seems like they might be of assistance to you as well. I'm unfamiliar fairly with SQL SERVER or this "Pervasive" DB you're using, but you might be able to get something from all this. hopefully so.
 
Last edited:
Hi there, thanks for the reply. I fully understand that mysqli is for mysql only I was merely telling you what I'm using now.
I however want to connect either to Acess tables or to Pervasive - I've Googled the topic a lot before coming here,
so I would have liked a solution more than telling me to Google.
I'm sure there is someone out there that can simply share the connection string needed for at least Access (since this is not a Pervasive forum I don't expect that).
Hope someone can still help with the Access connection needed in PHP
Thanks
 
I however want to connect either to Acess tables or to Pervasive - I've Googled the topic a lot before coming here,
so I would have liked a solution more than telling me to Google.
well I might have read your question wrong, but if you're looking for a free solution to a question like this, you really should understand that your question is not asked a lot. on any forum for that matter, because MS Access and PHP are completely unrelated in a multitude of ways. 1) they are created and maintained by different manufacturers, 2) they serve different purposes, etc....so I gave you a google link because I encounter all kinds of people here who, for some reason or another, do not know how to effectively use google's search algorithm to get exactly what they need. perhaps you have missed this search as well?

https://www.google.com/search?q=ms+access+connect+php .

take a look at the 1st result on that page, which is this post on S/O:

https://stackoverflow.com/questions/19807081/how-to-connect-php-with-microsoft-access-database .

answer #3 at the bottom gives a nice litle ODBC connection string that just might help you out! I'm sure you're a good googler, but google's software in this day in age, from what I have seen, does not yield very many results when asking full questions like this:
"how do I connect ms access to PHP?"
but rather it acts like human resource software and scans for keywords (which can also be found in the meta data of any given webpage on the internet):
php connect ms access
or:
ms access connect php
you can even throw the recognizable string ODBC in there too, because ODBC is the most popular source of database connectivity, regardless of platform.
 
I am not a php nor pervasive person, but I suggest you look at the Similar Threads at bottom of the page for some more focused info.
 
Thanks - I tried option 3 - and I must say I tried a lot of similar ones but it keeps failing with "Could not find database file."
Not sure where I'm going wrong.

<?php
$dbName = "C:\Users\Private\Desktop\PSQL2MySQL.mdb";
if (!file_exists($dbName)) {
die("Could not find database file.");
}
$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;");
?>
 
I'm not an expert in this type of connectivity, freshman. but is there anything here? https://boraqavysuwa.cf/1562.php

you should also do what the mod just said and look at the related threads. the PHP documentation says that your file_exists() function should work on windows. as far as the odbc you posted, you've got a typo in it. is shoulde be:
Code:
$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;");
 
come to think of it freshman, are you sure that the "file not found" error isn't being caused by some other issue? like, say, you don't have an ODBC driver installed? many times in many scenarios, errors make no sense because error numbers can be thrown due to a number of related issues to the primary issue that's associated with the error text or number. that's very common in PHP, actually.
 
I think I have because when I run phpinfo I can see ODBC under the PDO tab (along with mysql etc)
 
YEAH, but what does it say under the two columns? there's 2 columns, isn't there?
 
What I'm going to do now as a workaround is link the Pervasive tables to Access and then "on open" I run code to export the tables to mysql and then I use PHP to connect "normally". The downside is that the data will not be live. But for this Client I have to create a "report writer" which superimposes data onto an existing pdf (I use FPDF and FPDI to do that). So no data will be entered on the web interface - if will just be pulled in. I still would like to connect to the Pervasive database as 1st prize or else Access (linked to the Pervasive db) as 2nd price in which both cases the data will be live and I can build nice web interfaces on that
 
YEAH, but what does it say under the two columns? there's 2 columns, isn't there?

See attached - does that help?
 

Attachments

  • Screenshot_2.jpg
    Screenshot_2.jpg
    100.8 KB · Views: 149
it all looks good to me, freshman. I don't see anything that's off or looks wrong. if I were you, I would tell your client that PHP and MYSQL were created specifically to work together, and if their' desire is to use access, they should seriously think about buying services from microsoft like SSRS or sql server because both of those products were created by that company. MS is totally different than the open source GNU license folks on so many levels. 1 is level of competence, the other is level of quality, and then of course there is reliability of the software itself! both sides are good at some things. it's a push, completely. kind of like the USA congress. :p
 
Haha - I agree but the Access is my idea as a Workaround. This is the background: In the Client's country there is a major Payroll Service provider who is using Pervasive SQL as a backend. This Client wants me to develop a frontend (I want to make it a web interface) that connects to the Pervasive data. So that is why I'm trying to connect to it via Php but if that fails I'll connect to it via Access and then export the data to mysql so I can connect via php.
Wow - it sounds like a long story when I say it hey.
So 1st prize is still to connect to Pervasive from Php
 
well more than likely you can do it. and speaking of running access on a web server literally, have you seen stuff like this?

https://social.msdn.microsoft.com/F...-run-access-program-with-vba-in-a-web-browser

I remember reading another article that explained in details how to do it, but I can't find it anymore. the site must have been shut down. if you want to make a web-based interfaced, you shouldn't even be thinking about access. you can't do it. it's a desktop front end, nothing else. it's limited. if you want a good-looking front on a website, why not look into advanced javascript techniques and PHP on the backend? you could use the extremely popular jQuery libraries:

https://jquery.com/download/
 
So I will not really build anything visual in Access
and honestly, you shouldn't if your client is indeed interested in seeing something extremely appealing to the eyeball. Access is limited because it's a small application. if you want the nuts and bolts, start learning asynchronous software, like what the big corps are currently obsessed with:

=> jQuery
=> React
=> js.NODE
=> Angular
=> RESTful API (this is totally ridiculous and not even needed, but that's corporate thinking for you!)
 
Still but how do I get the data in (or connect to it) hosted in the Pervasive db?
 
I have no idea, man! we've already googled the he$$ out of the thing! are you aware that there is more detail to your issue than just stating it's "pervasive"? according to the searches, there are many incarnations of the platform(s) associated with a "pervasive" database. isn't there?
 

Users who are viewing this thread

Back
Top Bottom