Board index   FAQ   Search  
Register  Login
Board index php forum :: Database Other Database Engines

MS Access connection issues

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

Moderators: macek, egami, gesf

MS Access connection issues

Postby benjihubbs » 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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
</html>
<?php

$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'";


?>

<body>
</body>
</html>


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?

Cheers
Ben
benjihubbs
New php-forum User
New php-forum User
 
Posts: 11
Joined: Sun Dec 12, 2010 3:20 am

Re: MS Access connection issues

Postby johnj » Thu Jun 21, 2012 5:51 am

Add appropriate error validation/trapping to see what is going wrong.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to Other Database Engines

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.