Connecting to Sage Line 50 with PHP


I am trying to connect to Sage Line 50 v15 using PHP but having no luck what so ever.  I have the ODBC driver installed and that works fine on the server using excel to get data.  Every time i try to connect to sage using PHP i get nothing.  No error messages on screen and no connection.

I am running php 5 on windows xp with IIS.

I have writen a script to get around my problem for the minuet but i would like to get this all in one file for the minute.

Thanks in advance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bruce DenneySage 50 Consultant and IntegratorCommented:
ODBC is very slow on Sage even if you did get it to work.

My suggestion is that you cache the query in another more open/accessible database format (eg CSV or MySQL) using a scheduled task to keep it relatively up to date.

If you have to be live, then ODBC should work.  

Here are a bunch of issues to consider

The path to the data needs to include the accdata at the end
The username and password must be valid
The user that the PHP is run under needs access to not just the data path but various other places that I hope it is not granted access to by default, running procmon/filemon should help you establish what rights it needs.

Sage decided to use a comma a as the ODBC delimiter, this leads to some ambiguous SQL which other application are unhappy with, the most notable one being Open Office data pilot that just refuses to create the ambiguous SQL that sage demands.  Using direct SQL avoids this problem in Open Office.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
makieukAuthor Commented:
Thats what i have done at the moment.  Got a macro to refresh the data and save as a csv file then run my PHP script to read the CSV and import into mysql.

If you think this is the best way of doing this then i will stick to what i have done.

I would have liked to do this with PHP script then if this needs to be run manually i can just point our user to a link.  Currently i have given them instructions on how to run the scheduled task remotly and then the link to the import script.

This will be so much easier when sage release there SQL backend DB
Bruce DenneySage 50 Consultant and IntegratorCommented:
You are assuming that the database will not be encrypted.  Sage are unlikely to make the data writeable or easily accessible, this is an accounting system after all it is meant to be confidential.
makieukAuthor Commented:
Yeah no encryption on sage data at the moment but their might be in the SQL version.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.