Jump to content

How I Connect Ms-access Db With Php Using Odbc?


Talent87

Recommended Posts

HI, to all I have a problem in connecting the MS_access db with php using odbc , I don't understand the steps that have been written on http://www.w3schools.com/PHP/php_db_odbc.asp , the steps that I don't understand are step 6 -7- 8 , i used the code exactly that connects odbc with access northwind db , this error will occure when i browse my page on localhost 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:\wamp\www\odbc2.php on line 2Warning: odbc_exec() expects parameter 1 to be resource, boolean given in C:\wamp\www\odbc2.php on line 4the code I have used was this chunk below:<?php$conn=odbc_connect('northwind','','');$sql="SELECT * FROM customers";$rs=odbc_exec($conn,$sql);?>plz help

Link to comment
Share on other sites

That code says you're trying to use a DSN called northwind, and the error says that you haven't created a DSN with that name. Step 6 in the instructions means you need to point it to the MDB file. Step 7 is where you say what DSN you want to use, so call it northwind if that's what your code is trying to connect to.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...