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?