I am not able to connect Access through wamps5 1.7.3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashok Parhi
    New Member
    • Aug 2010
    • 1

    I am not able to connect Access through wamps5 1.7.3

    Ia m aun able to connect the MS access through Wamps5 1.7.3

    Here is the code

    Code:
    <?php
    // Two versions of Microsoft Office.  Choose one.
    //$db = 'C:\EmployeeDetails.mdb';
    $db = 'C:\wamp\www\empdetails\EmployeeDetails.mdb';
    $conn = new COM('ADODB.Connection') or exit('Cannot start ADO.');
    
    
    // Two ways to connect. Choose one.
    //$conn->Open("dns=Microsoft.Jet.OLEDB.4.0; Data Source=$db") or exit('Cannot open with Jet.');
    $conn->Open("vt={Microsoft Access Driver (*.mdb)}; DBQ=$db") or exit('Cannot open with driver.');
    $sql = 'SELECT * FROM Emp_Details order by gradepaydummy DESC';
    $rs = $conn->Execute($sql);
    ?>
    <table>
    <tr>
     <th>Srno</th>
         <th>Employee Name</th>
         <th>Father Name</th>
         <th>Designation</th>
         <th>Pay Band</th>
         <th>Grade Pay</th>
         <th>Date of Birth</th>
         <th>Date of Joining</th>
         <th>Date of Retirement</th>
         <th>Deputation/Direct</th>
    
    </tr>
    <?php while (!$rs->EOF)  ?>
    Error message is as follows


    Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft OLE DB Provider for ODBC Drivers<br/><b>Description :</b> [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified' in C:\wamp\www\emp details\empd.ph p:10 Stack trace: #0 C:\wamp\www\emp details\empd.ph p(10): com->Open('vt={Micr osoft A...') #1 {main} thrown in C:\wamp\www\emp details\empd.ph p on line 10

    Kindly help me to solve this issue

    I am awaiting for your valuable suggestion please

    With regards
    Ashok Parhi
    Last edited by Dormilich; Aug 4 '10, 08:59 PM. Reason: Please use [code] tags when posting code
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    please follow the link.
    link

    Comment

    Working...