Hi,

I have compiled php-4.0.4pl1 + apache-1.3.19 +  iodbc-3.0.4 (2.50.3) +
postgresql-7.1 (7.0.3)

odbc_connect returns error:

Warning: SQL error: Missing server name, port, or database name in call
to CC_connect., SQL state IM002 in SQLConnect in
/usr/local/apache/htdocs/test.php on line 9

Any ideas ?

Thanks,
Boris.

-----------------------------------------
My odbc.ini looks like:

[ODBC Data Sources]
test = PostgreSQL

[test]
Driver     = /usr/local/pgsql/lib/libpsqlodbc.so
ServerName = localhost
Database   = test
Port       = 5432
Username   = boris
Password   = something


and script looks like:

<?
    putenv("ODBCINSTINI=/usr/local/etc/odbcinst.ini");
    putenv("ODBCINI=/usr/local/etc/odbc.ini");
    $dsn = "DSN=test";
    $user = "boris";
    $password = "something";

    if($conn=odbc_connect("$dsn","","")){
        echo "connected";
        odbc_close($conn);
    }
    else {
        echo "not connected";
    }
?>

Reply via email to