Jump to content
Sign in to follow this  
Talent87

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

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

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  

×