PHP+Ms Access_Conection without dsn

itsys's Avatar
Banned
PHP Code:
<?php
$conn 
= new COM('ADODB.Connection') or exit('Cannot start ADO.');
$db 'C:\\wamp\\www\\test1\\database\\directorydb.mdb';
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db") or exit('Cannot open with Jet.');
$sql ='SELECT Category FROM tblCategories';
$rs $conn->Execute($sql,$db);
?>
<table>
<tr>
    <th>Category</th>
</tr>
<?php while (!$rs->EOF) { ?>
     <tr>
        <td><?php echo $rs->Fields['Category']->Value ?></td>
    </tr>
    <?php $rs->MoveNext() ?>
<?php 
?>
</table>

<?php

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

$rs null;
$conn null;

?>
i have create connection occure error "Cannot open with Jet."
pls, correct the code

Last edited by shabbir; 23Jun2009 at 16:17.. Reason: Code blocks
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Please get the exact error message.