PHP and MS Access: Number of Records returned by SELECT query
- by VarunGupta
I am running following PHP code to interact with a 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");
Using ($rs_select - RecordCount) gives -1 though the query is returning non-zero records.
(a) What can be the reason?
(b) Is there any way out?
I have also tried using count($rs_select -> GetRows()). This satisfies the need but looks inefficient as it will involve copying of all the records into an array first.