Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Revisit: Connect via ODBC on IIS with PHP

Status
Not open for further replies.

jonblack

Programmer
Nov 25, 2008
11
0
0
US
This has been discussed before but the threads are old and I want to revisit it.

I want to connect to MAS90 via the normal ODBC driver and PHP to the database found on a second server within the same local domain.

Goal: Mirror MAS90 data into MySQL database on webserver for daily reporting

- I have an IIS 6.0 on Server 2003 Standard and running PHP5.
- IIS is running all services with local service account.
- I installed Mas90 3.7 Workstation on the server. <Mas client works>
- I created a custom System DSN (MAS90db) using the default Mas90 driver with User/Pass/Company saved. <connection works>

I created the following PHP file:
Code:
<?php
$conn = odbc_connect('MAS90db','','');
if (!$conn)
    {exit("Connection Failed: " . $conn);}
else
    echo"Connected<BR>";

if (!$conn) {
	exit("Connection Failed: " . $conn);
	} else {
    	echo "Connected<br />";
		$query = "SELECT AR1_CustomerMaster.Division, AR1_CustomerMaster.CustomerNumber FROM AR1_CustomerMaster ORDER BY AR1_CustomerMaster.CustomerNumber";
		$result = odbc_exec($conn, $query) or die(odbc_errormsg());
		}
odbc_close($conn);
echo"Connection Closed";
?>

When run the script returns:
Code:
Connected
Connected
Warning: odbc_exec() [function.odbc-exec]: SQL error: [ProvideX][ODBC Driver][FILEIO]Table is not accessible, SQL state S000 in SQLExecDirect in D:\Webdata\apps\mas\test.php on line 27
[ProvideX][ODBC Driver][FILEIO]Table is not accessiblePHP Warning: odbc_exec() [function.odbc-exec]: SQL error: [ProvideX][ODBC Driver][FILEIO]Table is not accessible, SQL state S000 in SQLExecDirect in D:\Webdata\apps\mas\test.php on line 27

I changed the IIS directory security to disallow anon access and use the AD digest authentication to force a user/pass prompting. Used a valid MAS90 allowed user from within the domain with same results.

Nothing I try seems to allow access to the data itself. The ODBC connection seems valid but I cannot get a tables listing and all direct queries to a table by name fail.

I have tried some of the solutions mentioned in other threads; changing the service account user, using a connection string, etc. Nothing seems to help.

I would be interested in any technical responded help here. Any commercial solutions should be sent to my email directly.

Any help is appreciated.
Jon Black
862-432-6992
jblack@syncom.net
jonblack@hawkswing.com
 
You would get more and better responses if you posted on the Sage Community at community.sagemas.com

Note that the current version of MAS is 4.30 and in 3 months will move to v4.40. ALL support for v3.71 is due to end shortly thereafter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top