I am running the following PHPcode to interact with an MS Access database.
$odbc_con = new COM("ADODB.Connection");
$constr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . $db_path . ";";
$odbc_con -> open($constr);
$rs_select = $odbc_con -> execute ("SELECT * FROM Main");
Usage ($rs_select -> RecordCount)gives -1, although the query returns non-zero entries.
(a) What is the reason? (b) Is there a way out?
I also tried to use count($rs_select -> GetRows()). This satisfies the need, but looks inefficient, since it involves first copying all the records into an array.
source
share