2026-11-27

Sage 100 PHP ODBC Connection Not Pulling Results

Your Sage 100 PHP ODBC connection succeeds but pulls no results, ending in "[ProvideX][ODBC Driver][FILEIO] Table is not accessible"? The cause is permissions — here is the check order and the fix that worked.

Your PHP script connects to Sage 100 without an error — it even prints your "connection successful" message — and then every query comes back empty. odbc_tables() returns nothing. A real query returns nothing. Even Select 1 as test returns nothing. Dig one layer deeper and the driver finally says what it means:

[ProvideX][ODBC Driver][FILEIO] Table is not accessible

This is not a code problem. In the documented case, the identical PHP code ran correctly on another system. The connection succeeds because the DSN exists and the Sage logon is accepted; the queries return nothing because the process running your web site cannot actually reach the Sage data files with the permissions it needs. Work the checks in this order.

The fix

  1. Rule out Sage's own ODBC security first. In Sage 100, open Library Master > Role Maintenance. If "Enable ODBC Security within Role Maintenance" is turned on (set in System Configuration / security settings), the Sage user ID your DSN logs on with must belong to a role whose ODBC Security tab allows the companies and tables you are querying. A role with the boxes unticked connects fine and reads nothing — exactly this symptom. (In the original reported case every box was already ticked, which is what proved the block was elsewhere.)
  2. Test the DSN outside PHP, on the Sage server itself. On the Sage server, open the ODBC administrator, configure the same DSN, and run its test connection / a simple query against a normal data table (not a work table). If it works on the server, your driver, DSN, and Sage security are all healthy and the fault is the web server's path to the data.
  3. Check what account your web site runs as, and what it can reach. The ProvideX driver reads Sage's data files directly, so the Windows account behind IIS/PHP needs read access to the MAS90 data folders over the network — and a service account has no mapped drives, so the DSN must use UNC paths, not a drive letter. This is the step that fails in practice: permissions that work for an interactive user quietly fail for the web process on a separate machine.
  4. The resolution confirmed in the reported case: run the web site from the Sage server itself. Installing IIS and PHP on the MAS server and serving the site from there put the web process local to the data files, and the same queries immediately returned results. It is not the theoretically cleanest architecture — the poster said so himself — but it is the fix that is documented to have worked, and for a small site it removes the entire cross-server permissions problem in one move.
  5. If the site must stay on its own server, keep working step 3 until the web process account can open the data files directly: System DSN (not User DSN), UNC paths, and share and NTFS permissions granted to the account the application pool runs under. (Unconfirmed: whether the web server also needs the Sage workstation components installed, and the exact role of the Client/Server ODBC service on Advanced, is not settled by the source thread or a Sage KB article we could verify — the thread confirms only the permissions cause and the on-server resolution.)

Causes / why this happens

Sage 100 Standard and Advanced store data in ProvideX files, not in a database server. An ODBC "connection" only proves the driver loaded and the logon was accepted; every query after that is a file read performed by your web process, under its Windows identity, across your network. Anything that breaks that file read — share permissions, a missing mapped drive for a service account, Sage's role-based ODBC security — surfaces as an empty result set first and as "Table is not accessible" once the driver reports honestly. That is why the code can be perfect and the result still empty.

Per-context variants

"Table is not accessible" on one specific table only: that message also appears when you query a work table, or a table locked by active processing (for example while a register update is running). If most tables read fine and one refuses, suspect the table, not your permissions.

Querying through SQL Server as a linked server, or from Python/C# instead of PHP: the same FILEIO message appears in those contexts for the same underlying reason — the calling process cannot access the data files. The check order above (Sage ODBC role security, then the calling process's Windows permissions and paths) applies unchanged.

Sage 100 Premium: none of this applies. Premium data lives in SQL Server; query SQL Server directly with SQL credentials instead of the ProvideX driver.

What doesn't work

  • Adding DSN= to the connect call. Changing odbc_connect("SageODBC", ...) to the DSN=... form turned this poster's working connection into an "unable to connect" failure. If you connect, your connect string is not the problem.
  • Hunting through php.ini. No PHP configuration setting was ever identified as the cause in the documented case. The failure lives below PHP, in the driver and the file system.
  • Rewriting the query. A contributor ran the poster's exact code, including the odbc_tables() loop, on his own system and got the full table list back. The code was never the fault.

Affected versions

Reported against file-based Sage 100 (Standard/Advanced, ProvideX) of the MAS 90/100 era; no specific version was named in the thread. The mechanism — file-based data plus optional role ODBC security — is the same on current Standard and Advanced releases. Premium (SQL) is not affected.

Prevention / best practice

  • Decide where the web process will run before you build the integration, and test ODBC from that exact machine and account — not from your own workstation, where your personal permissions hide the problem.
  • Use a dedicated Sage user and role for ODBC, with the ODBC Security tab granting only the tables the application needs.
  • Build with UNC paths and a System DSN from day one, so the integration survives being run as a service.
  • Keep a known-good test — one small query against one ordinary table — and run it after every server, permission, or Sage upgrade change.

Related help

Still stuck? Send us a screenshot of the error, we will diagnose it for free.

Digit Masters has supported Sage 100 and Sage 300 since 1997. Send the screenshot through our contact page or to contact@digitmasters.com, or call (800) 965-4262.

Ready to Optimize Your Sage ERP?

Speak with a CPA-led Sage consultant. Free initial consultation — English or Chinese.

Get a Free Consultation