Informix PDO connection : Error SQLSTATE=HY000, SQLDriverConnect: -329 sqlerrm(systables)

2.4k views Asked by At

it has been days (weeks ?) since I try to connect to an Informix SQL database with PHP but I can't make it work. I'm stuck with this error :

SQLSTATE=HY000, SQLDriverConnect: -329 [Random characters, ex :`�%] sqlerrm(systables)

I can make the link with Windows ODBC utility https://i.stack.imgur.com/1ChAL.png But impossible on PHP. I installed the informix drivers and the informix dll extension for php and run it like this:

putenv("INFORMIXDIR=C:\\informix");
    try {
        $db = new PDO("informix:host=iat-----; service=sqlexec; database=sige---; server=iat-----; protocol=sesoctcp;", "if----", "pass---");
    } catch (Exception $e) {
        echo('Erreur : ' . $e->getMessage() . '<br>');
    }

Thank you for your kind help.

2

There are 2 answers

0
Jonathan Leffler On

Error message -329 is:

Database not found or no system permission

It means that despite your best efforts, something is astray with the environment. Either you've misspelled the database name or the server name, or the database is not set up to allow the user access to the database, or something along those lines.

Much more than that, I can't help you with. You're on Windows, and I'm not. You can look at the SETNET32 settings, but the fact that you can connect via the Windows ODBC utility suggests that most of what you need should be OK.

2
sr1994 On

To fix this, you must restart the services for apache and php. If you are in linux, you can use the command "/etc/init.d/httpd restart"

This will fix the following error message:

Ocurrió un error ConexionPDOSQLSTATE=HY000, SQLDriverConnect: -11005 [Informix][Informix ODBC Driver]Unspecified System Error...