I'm trying to read rows from a .mdb file (MS Access) on Linux (Ubuntu), I've installed php5-odbc, mootools etc... My code is:
$dbName = "/path/file.mdb";
$handle=odbc_connect ("DRIVER=MDBTools; DBQ=$dbName;", "", "");
if(!$handle) {
print "<p>Uh-oh! Failure to connect to DSN: <br />";
odbc_errormsg();
}
else {
print "done";
$resultset=odbc_exec ($handle, "SELECT DISTINCT(col) FROM tab");
odbc_result_all($resultset, "border=2");
odbc_close($handle);
}
if I change SQL clause to SELECT col FROM tab
it works well... Instead with DISTINCT clause I have this error:
odbc_exec(): SQL error: [unixODBC]Couldn't parse SQL, SQL state 08001 in SQLExecDirect
I've tried with square brackets and without too but it's the same... Help!!