I am trying to connect to a legacy system running on VMS using the
Attunity Connect ODBC driver from within PHP. I know the System DSN
works because SQL Server has been using it successfully for years. I
want to access the info on VMS from within PHP and this is when all
goes pear shaped!
I have tried various ways...
1) If I am in query analyser and type 'SELECT * FROM
DNSNAME...TABLENAME' etc. This works fine. But if I try putting this
within a SQL string within PHP I get the following error..
"Hetrogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options
to be set for the connection. This ensures consistent query
semantics.....
Varies postings relating to this very message appear on groups, most of
which state to set these ANSI variables and try again. I have but still
no joy!
2)From within PHP just create a normal ODBC connection, refere to the
DSN in question and try a query such as:-
<?php
$link_id = odbc_connect ('DSNNAME','','');//Links to database
if ($link_id){
echo "connected to DSNNAME!!<br>";
$sql = "SELECT top 10 proj_name, area
FROM projects";
$exec = odbc_exec($link_id, $sql);
}
if ($exec)
{
echo "selection completed<br>";
while ($row = odbc_fetch_row ($exec))
echo $row->id."<br>";
}
else
echo "ERROR - connecting to DSNNAME!!";
?>
This also fails, with the following message...
SQL error:[Attunity][Attunity Connect Driver][A077]DS Name DSNNAME does
not appear in the binding entry.,SQL state S1000 in SQLConnect in
d:\intranet\test scripts\dsntest.php
As a final straw I tried connecting by using the method....
$conn = new COM('ADODB.Connection');
$conn->open("DRIVER={Attunity Connect Driver}).... etc....
No diffrent....
I can connect to a simple Access database by setting up an ODBC
source...
So there seems to be an issue between PHP and the Attunity Driver, and
I am now officially annoyed....
Has anyone else tried a similar combination because I would desperately
like to chat with you!