473,388 Members | 986 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Connecting to a Access database using ODBC and no DNS

23
Hi, I'm having problems connecting to a Microsoft Access database. Im using PHP and ODBC but im not using a DNS.

The scripts below give no errors but I they only give me a blank white screen.

Any would be greatly appresiated. Please help.

Script 1
[php]
<HTML>
<HEAD>
<TITLE> Browse the race table </TITLE>
</HEAD>
<BODY>
<?php
$connstr = "DRIVER={Microsoft Access Driver(*.mdb)};DBQ=".realpath("Database/2PointB.mdb").";";
$conn=odbc_connect($connstr,",");
$stmt=odbc_tables($conn);
while( odbc_fetch_row($stmt))
{
$tabletype = odbc_result($stmt,4);
$tablename = odbc_result($stmt,3);
if($tabletype =="TABLE")
{
Print "<a HREF=browserace.php?table=" .$tablename.">" .$tablename ."</a>";
Print "<br>";
{
}
?>
</BODY>
</HTML>[/php]Script 2[php]
<HTML>
<HEAD>
<TITLE> Browse </TITLE>
</HEAD>
<BODY>
<?php
$table=$_GET["table"];
$sql="Select * from $table";
$connstr = "DRIVER={Microsoft Access Driver(*.mdb)};DBQ=".realpath("Database/2PointB.mdb").";";
$conn=odbc_connect($connstrr,",");
$stmt=odbc_exec($conn,$sql);
$nofileds=odbc_num_fields($stmt);
while( odbc_fetch_row($stmt))
{
$i=1;
while ($i<$nofields)
{
Print odbc_result($stmt,$i)."";
$i==;
}
Print "<br>";
}
?>
</BODY>
</HTML>[/php]
Apr 12 '08 #1
1 2876
ronverdonk
4,258 Expert 4TB
You don't get an error, because you don't display any errors. Add an error display to each of the odbc_* command like[php]$conn=odbc_connect($connstr,",")
or die ("connect error: ".odbc_error());
$stmt=odbc_tables($conn)
or die ("show table error: ".odbc_error());[/php]and you'll get more information on your problem.

Ronald
Apr 12 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ehendrikd | last post by:
hi all im very new to using db2 so please excuse any obvious newbie questions :) my situation is this... we have a v7.1 db2 database running on redhat 9 and i am trying to use enterprise...
3
by: Rob | last post by:
Is there a way of connecting to a database on my server using Microsoft Access. I want to be able to modify my database without having to download it, ammend it and then upload it back again ...
1
by: Kavvy | last post by:
I'm working on a Win app and in the Data tab there are only classes for OleDB and Sql. I create an OleDB (Using the Microsoft OLE DB Provider for ODBC) connection to my Access DB, but it throws...
0
by: Rico | last post by:
Hello, I have an ASP web app with an SQL back end. It's currently connecting to an SQL Server 2000 database using an ODBC DSN. I am currently migrating to a new Windows 2003 Server machine...
14
by: Peter | last post by:
I am trying to connect to a DB2 database with IBM.Data.DB2 provider and getting the following message ERROR SQL30081N A communication error has been detected. Communication protocol being...
3
by: Mike | last post by:
I have transferred the data from Access to MySQL using MySQL's tool. The transfer worked great and saved me a lot of time (thanks MySQL). Now I'm trying to get the Access database, or a new access...
4
by: Tracey | last post by:
I have a Mysql database hosted on a remote server. Previously, I could always connect to those databases using the 3.51 ODBC connector and linking the tables in Access. The benefit of this is that...
1
by: Chevylover54 | last post by:
We have been using ODBC connections that are in the registry of the computer. However these connections aren't in by default so when a new user uses the Access program or when a current user goes to...
8
by: Daveo | last post by:
Dear all, We recently migrated a SQL database from one server to another. Now, when you try to run some code in an Access Database which links to the SQL one, you get a 3704 error "Operation is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.