MS Access connection issues

Do you have questions regarding other database enginges (not MySQL) -- ask here!

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 11
Joined: Sun Dec 12, 2010 3:20 am

Sun Jun 17, 2012 3:02 pm

Hey Guys,

Not posted for a while, but have come across an issue that I need your help on ;)

I'm trying to link an MS Database with a website, I can't use MySQL for reasons I cba to explain, I have this code:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

$user = "";
$password = "";
$DBLocation = "C:\Users\ben\Documents\Inspections.mdb";

// Microsoft Access
$connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=" . $DBLocation . "", $user, $password);
"SELECT * FROM 'Inspectiontypes'";
"echo= 'Agency'";


No errors come up when I run the script, so that's all good, but it isn't displaying the data I want it to, i.e. the list of agencies in the table "Inspectiontypes". All I get is a blank screen

Any ideas?


php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Thu Jun 21, 2012 5:51 am

Add appropriate error validation/trapping to see what is going wrong.

Post Reply