$db = "DB_PCRent.mdb";
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");; $conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath($db));
$Rec = new COM("ADODB.Recordset");
Date :
2012-02-14 15:16:35
By :
webmaster
No. 6
Guest
Code (PHP)
<?php
$db = "D:\data\job\job.mdb" ;
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");;
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath($db));
$Rec = new COM("ADODB.Recordset");
?>
<?php
$rs2 = $conn->execute("SELECT * FROM apply_education where list1 = '5'");
$Rec->Open($rs2, $conn, 1,3);
$TotalRecord = $Rec->RecordCount();
echo $TotalRecord;
?>
error
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> ADODB.Recordset<br/><b>Description:</b> Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.' in D:\xampplite\htdocs\job\Sample2.php:38 Stack trace: #0 D:\xampplite\htdocs\job\Sample2.php(38): com->Open(Object(variant), Object(com), 1, 3) #1 {main} thrown in D:\xampplite\htdocs\job\Sample2.php on line 38