Here is the code
Expand|Select|Wrap|Line Numbers
- <?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) ?>
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\empdetails\empd.php:10 Stack trace: #0 C:\wamp\www\empdetails\empd.php(10): com->Open('vt={Microsoft A...') #1 {main} thrown in C:\wamp\www\empdetails\empd.php on line 10
Kindly help me to solve this issue
I am awaiting for your valuable suggestion please
With regards
Ashok Parhi