Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   PHP+Ms Access_Conection without dsn (http://www.go4expert.com/forums/phpms-accessconection-dsn-t18155/)

itsys 23Jun2009 12:25

PHP+Ms Access_Conection without dsn
 
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

pradeep 24Jun2009 10:26

Re: PHP+Ms Access_Conection without dsn
 
Please get the exact error message.


All times are GMT +5.5. The time now is 02:47.