Jump to content

a terrible error


Guest error_error

Recommended Posts

Guest error_error

hii have tried to open a php file with code mentioned below and got following error,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:\Inetpub\wwwroot\test.php on line 3Connection Failed: i have create an ODBC connection to a MS Access Database but still having the same error.plz guide methanx a lot :)PHP code:<html><body><?php$conn=odbc_connect('northwind','','');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>Companyname</th>";echo "<th>Contactname</th></tr>";while (odbc_fetch_row($rs)){ $compname=odbc_result($rs,"CompanyName"); $conname=odbc_result($rs,"ContactName"); echo "<tr><td>$compname</td>"; echo "<td>$conname</td></tr>";}odbc_close($conn);echo "</table>";?></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...