0

The Manual: http://www.php.net/manual/en/function.odbc-data-source.php

The facts:

<?
$DSN = 'Driver={Microsoft Access Driver (*.mdb)};Dbq=test.mdb';

$cnx = odbc_connect( $DSN, '', '' );
if (!$cnx)
    Error_handler( "### Error in odbc_connect ###" , $cnx );

$result = odbc_data_source( $cnx, SQL_FETCH_FIRST );
if (!$result)
    echo "### Error in odbc_data_source ###\n";

while($result) {
    if (strtolower($DSN) == strtolower($result['server'])) {
        echo $result['description']."\n";
        break;
    } else $result = odbc_data_source( $cnx, SQL_FETCH_NEXT );
}
?>

The result:

Warning: odbc_data_source() [function.odbc-data-source]: SQL error: Failed to fetch error message, SQL state HY000 in SQLDataSources in \labs_blob2.php on line 8
### Error in odbc_data_source ###

Is there a solution ?
It just doesn't works ?
Do you know a good Manual ?
Thanks for help.

Baghera
  • 53
  • 6
  • Which line is line #8? Are you able to connect to ODBC via this driver with another application? Maybe the driver's name is wrong. – Voitcus Mar 11 '13 at 11:57
  • Line #8 is :$result = odbc_data_source( $cnx, SQL_FETCH_FIRST ); And the driver's name works fine with other uses. – Baghera Mar 11 '13 at 16:58
  • The comments in PHP Manual are 8 and 9 years old !! – Baghera Mar 11 '13 at 17:01

0 Answers0