• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 458
  • Last Modified:

Connecting to Sage Line 50 with PHP

Hi,

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
Makie
0
makieuk
Asked:
makieuk
  • 2
  • 2
1 Solution
 
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.
0
 
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
0
 
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.
0
 
makieukAuthor Commented:
Yeah no encryption on sage data at the moment but their might be in the SQL version.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now