[Linux] OpenVPN Progress ODBC PHP

Marcel

New Member
Hello community,

as this is my first post here, I will introduce myself first. My name is Marcel and I am an interface-coder at a medium-size software-company which creates webshops.

I am responsible to connect the webshop to an ERP-system (like GWS, Sangross, DIACOM, SAP etc.pp) with XML, SOAP, Rest or similar webservices.

So: Now one customer is using a VPN-Tunnel and wants me to connect from our linux-machine over the tunnel to a progress-database.

Our webshop is based on php so I decided to connect through odbc and open a connection to a remotehost through the vpn-tunnel.

The tunnel works like a charm but now I am on a blind alley barking the wrong tree. (and english is not my native language so never mind)

What exactly do I have to do to get this piece of code working:

PHP:
<?php 
$server = 'localhost';
$database = 'sanitaer';
$user = 'sansys';
$password = 'myfantasticpassword';
$port = '2502';
$isolationlevel = 'READ UNCOMMITTED';
$connection = odbc_connect("DRIVER={Progress OpenEdge 10.2B Driver};Hostname=localhost;Port=2552;Db=sanitaer;UID=sansys;PWD=Progress;DIL=READ UNCOMMITTED", $user, $password);
$sql = "SELECT kdnr from SANITAER.PUB.kund";
$rs = odbc_exec($connection, $sql);
print $rs;
print odbc_result_all($rs);
odbc_close($connection);
?>

Please consider myself dumb and goofy because I absolutely do not have ANY idea how to even start.

Which drivers should I use? Where do I get them (we do not own Progress here)? How do I write an odbc.ini,odbcinst.ini and make php use them?

A lot of questions but as I even tried everything else and nothing worked, I need the help of you ;)

Kind regards,
Marcel
 

RealHeavyDude

Well-Known Member
You must understand that the Progress database is not and SQL database in the first place. Neither is talking to it via SQL the natural way to talk to it. Therefore the SQL access on the database side is either not there in a way you can use it or not there at all out-of-the-box. It must be set up accordingly by the DBA responsible for the Progress database before you are even able to connect it via ODBC/JDBC the first time. The most obvious stepping stone is the security on the SQL engine which is handled completely different that the one on the 4GL engine (this is THE database engine of the Progress database and 4GL - or ABL as it is called nowadays - is the natural way to talk to it).

Progress does sell ODBC/JDBC drivers as a commercial product. But they are also included in every OpenEdge runtime license they offer. There are also some other ODBC/JDBC drivers available - OpenLink is one example - but I don't have any experience with them.

Plus, I don't have any PHP knowledge - so I can't be of any help in the PHP topic.

HTH, RealHeavyDude.
 

Marcel

New Member
Thanks for your reply RealHeavyDude,

as far as I know the DBA already set up a "SQL-Gateway". I got a complete manual about how to adress customer-data, fetch prices and post orders. The openlink-drivers were the first ones I tried without success. Maybe somebody already created an odbc-connection with linux to a remote-server. I will keep watching this.
 

Stefan

Well-Known Member
I have no experience with using ODBC on Linux, but the ODBC drivers for all supported platforms (including Linux) are included in a 'free' product named SQL Client Access. However, to be able to download this product you do seem to need to have a valid Progress license. Your customer should be able to download this for you.
 

Marian EDU

Member
why don't you save yourself from troubles and use web-services instead, low-level raw data access to a business application should be discouraged nowadays... you most probably don't want/need to put any business logic on your web-interface, just let the application business logic provide you the data you need.

however, if application server is not in place and building something like 'services' in existing application is close to science-fiction domain you might use ODBC and it should work... just let us know the Progress version you have in place and we might be able to direct you to the right documentation manual for ODBC access :)

another thing you might consider is to use the PHP interface of ganimede - kinda of a poor man appserver ;)
 
Top