What is the potential cause of the SQL error [Microsoft][ODBC Microsoft Access Driver] when accessing an Access database in PHP?

The potential cause of the SQL error [Microsoft][ODBC Microsoft Access Driver] when accessing an Access database in PHP could be due to incorrect connection settings or SQL syntax errors in the query. To solve this issue, ensure that the connection string is correct, and double-check the SQL query for any mistakes.

<?php
$db_path = "C:/path/to/your/database.accdb";
$conn = new COM("ADODB.Connection");
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=$db_path");

$sql = "SELECT * FROM table_name";
$rs = $conn->Execute($sql);

if (!$rs) {
    echo "Error executing query: " . $conn->Errors[0]->Description;
} else {
    while (!$rs->EOF) {
        // Process the results
        $rs->MoveNext();
    }
}

$rs->Close();
$conn->Close();
?>