0

I'm having a problem in connecting my access database using php. The wampserver displays a message of Parse error. I have connected my access db through control pannel's option administrative tools,but no output.plz help me....
The server shows the following message:
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt., SQL state S1000 in SQLConnect in E:\wamp\www\New Folder\my.php on line 5
Connection Failed:

<html>
<body>

<?php
$conn=odbc_connect('mgdatabase','','');
if (!$conn)
  {exit("Connection Failed: " . $conn);}
$access="SELECT * FROM Student";
$rs=odbc_exec($conn,$access);
if (!$rs)
  {exit("Error in access");}
echo "<table><tr>";
echo "<th>StudentName</th>";
echo "<th>Contactname</th></tr>";
while (odbc_fetch_row($rs))
  {
  $compname=odbc_result($rs,"FirstName");
  $conname=odbc_result($rs,"LastName");
  echo "<tr><td>$compname</td>";
  echo "<td>$conname</td></tr>";
  }
odbc_close($conn);
echo "</table>";
?>

</body>
</html>
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by CFROG
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.