Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\xampp\htdocs\xampp\display.php on line 5
Connection Failed:
php is working fine, ran other simple php scripts...
but this is the error when i connect to a ms access db
<html>
<body>
<?php
$conn=odbc_connect("DB",'','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$sql="SELECT * FROM customers";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr>";
echo "<th>IP</th>";
echo "<th>MAC</th></tr>";
while (odbc_fetch_row($rs))
{
$name=odbc_result($rs,"ip");
$macname=odbc_result($rs,"mac");
echo "<tr><td>$name</td>";
echo "<td>$macname</td></tr>";
}
odbc_close($conn);
echo "</table>";
?>
</body>
</html>
the dsn exists and i have selected a db which has the table clients_online and other fields such as ip and mac exist