PHP & Attunity Connect problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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
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:-


$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>";
    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
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!

re:PHP & Attunity Connect problem

I'm trying to use Attunity Connect on PHP/Linux too (Debian).

Have you solve your problem ? If yes, a little help would be

appreciate :)

I think you can't put an URL in the DSN. You have to use a software

like unixodbc to configure an ODBC link. Then, in your web page, you

must point on your ODBC link.

I tried on a Windows Host, with succes. I installed an Attunity Sdudio

on my machine, and made an ODBC link 'Tolas'.

In my PHP page, I used the DSN : "odbc://Tolas"

Now, for Linux, I have absolutely no idea on how to do :'( -php- web design

Re: re:PHP & Attunity Connect problem

Hi glad to hear from you... Hope your still viewing the post, I almost
forgot about it myself!

I would be interested in seeing a code example of how you got it
working in a Windows environment, as I thought I had done exactly as
you did.

Was there and special settings in the ini file?
I can't see anything there that iv'e missed.

I'me afraid my situation is pure Windows and not Linux, so don't think
I can help you on that one. I assumed the problem to be because the
ODBC link is referencing a seperate VMS machine, however collegues of
mine use the very same ODBC link through VB and ASP! I figured there
was something dodgy with PHP. Anyhow I will revisit the problem today.
If you do get to the bottom of your linux problem please do let me
know, as you never know which technologies are going to be thrown at


Worst wrote:
Quoted text here. Click to load it

Site Timeline