Sage 100

 View Only
  • 1.  Having an issue doing a query on a MAS200 database

    Posted 05-14-2012 07:36
    Having an issue doing a query on a MAS200 database, any idea what we're missing? Web server is running IIS on W2k3. The machine is a member server of the domain. ODBC Security is not enabled and the Allow External Access option is checked in company maintenance. This is the Test.PHP on the web server. It first tests for connectivity through the ODBC System DSN ""SAGE"". Then it tries to return some data from a table. '; } //$sub_query = ""SELECT SO_ShipToAddress.CustomerNo, SO_ShipToAddress.ShipToCode, SO_ShipToAddress.ShipToName, SO_ShipToAddress.ShipToAddress1, SO_ShipToAddress.ShipToAddress2, SO_ShipToAddress.ShipToCity, SO_ShipToAddress.ShipToState, SO_ShipToAddress.ShipToZipCode FROM SO_ShipToAddress""; $sub_query = ""SELECT * FROM CI_Item""; $sub_result = odbc_exec($connect, $sub_query); while(odbc_fetch_row($sub_result)) { echo $real_qty = odbc_result($sub_result, ""SO_ShipToAddress""); } exit; Here is the result when we load the TEST.PHP into the browser: ODBC Connected Warning: odbc_exec() [function.odbc-exec]: SQL error: [ProvideX][ODBC Driver][FILEIO]Table is not accessible, SQL state S0000 in SQLExecDirect in C:\Inetpub\SandBox\test.php on line 14 Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in C:\Inetpub\SandBox\test.php on line 15 The first line returned indicates that the SAGE DSN worked, but the FILEIO error returned by line 14 says otherwise. If there is trick or requirement for pulling data from a Sage ProvideX database to the web? If we're doing it correctly, then what is the proper way to get this (or any) sql query to return data to a PHP web page?


  • 2.  RE: Having an issue doing a query on a MAS200 database

    Posted 05-14-2012 07:54
    Not sure if this will help, but I found this link online were other's were having a similar issue. http://community.sagemas.com/t5/Technical-and-Installation/ProvideX-ODBC-Driver-FILEIO-Table-is-not-accessible/td-p/18930


  • 3.  RE: Having an issue doing a query on a MAS200 database

    Posted 05-14-2012 08:28
    Here is an old post I had about it on our website: http://www.mbabsi.com/Troubleshooting-PHP-ODBC-Connections-to-MAS-90.html


  • 4.  RE: Having an issue doing a query on a MAS200 database

    Posted 05-14-2012 08:41
    You're also going to through an error in the line ""echo $real_qty = odbc_result($sub_result, ""SO_ShipToAddress"");"" -- SO_ShipToAddress is not a valid field in CI_Item.