473,769 Members | 7,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connecting to a Access database using ODBC and no DNS

23 New Member
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={Micros oft Access Driver(*.mdb)}; DBQ=".realpath( "Database/2PointB.mdb")." ;";
$conn=odbc_conn ect($connstr,", ");
$stmt=odbc_tabl es($conn);
while( odbc_fetch_row( $stmt))
{
$tabletype = odbc_result($st mt,4);
$tablename = odbc_result($st mt,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={Micros oft Access Driver(*.mdb)}; DBQ=".realpath( "Database/2PointB.mdb")." ;";
$conn=odbc_conn ect($connstrr," ,");
$stmt=odbc_exec ($conn,$sql);
$nofileds=odbc_ num_fields($stm t);
while( odbc_fetch_row( $stmt))
{
$i=1;
while ($i<$nofields)
{
Print odbc_result($st mt,$i)."";
$i==;
}
Print "<br>";
}
?>
</BODY>
</HTML>[/php]
Apr 12 '08 #1
1 2898
ronverdonk
4,258 Recognized Expert Specialist
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_conn ect($connstr,", ")
or die ("connect error: ".odbc_error()) ;
$stmt=odbc_tabl es($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
1679
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 architect on a windows xp machine to create some diagrams of the database via odbc. i tried installing db2 8.1 personal edition on the xp to gain access to
3
1876
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 My account supports MySQL but i dont really know much about this Any help will be appreciated
1
1572
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 the following error when I try to actually drag a table onto the form. "You cannot use a OLE DB provider for ODBC drivers" Any ideas on what might be wrong?
0
1492
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 and SQL Server 2005 Express. As usual, the app doesn't connect right away, but I've gone through all the new Windows 2003 Server security issues and I'm able to get a normal ASP page to display. I can also connect
14
11514
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 used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "10.100.1.69". Communication function detecting the error: "connect". Protocol specific error code(s): "10061", "*", "*". SQLSTATE=08001 When I use...
3
4366
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 database, to talk across ODBC and see the data. I created the DSN through the control panel and it works without error. How do I setup Access so it can see the data. The data
4
4031
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 I can view the data from my desktop, export it to spreadsheets if necessary and print labels. I guess because of a Mysql upgrade by my host, the 3.51 connector stopped working (the password hash problem), so I upgraded to the 5.* ODBC...
1
6050
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 a different computer, we have to send them the batch program to put the ODBC hooks on that machine. We want to get around that by using Pass-Through queries and the ODBC connection string. What we have got to work is this: ...
8
1796
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 not allowed when the object is closed". I think this means that the connection between the Access DB and SQL Server has not been made. - The IP address of the new server is the same as the old one and the host file on the client PCs has been...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9998
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.