473,394 Members | 1,749 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,394 software developers and data experts.

ODBC, PHP and a lack of understanding.

Greetings,

My problem consists of two parts, the first of which I imagine is only
a matter of syntax whilst the second might very well be impossible.

I'm not sure if it is of consequence but PHP is running on a Win2000
machine and the ODBC connection in question links to an MS-Access
database.

1/ I am trying to get my head around odbc_columns(). When using the
function in its simple case -- just providing a ODBC link -- all is
fine and it returns a dataset of all the columns in all the tables
fine. The problem is that I cannot ask it to list _all_ the columns
each time and I would like to be able to inspect just one table's
columns. (A major reason for this is that the target database
contains hundreds of tables and so odbc_columns() takes a long time to
complete.)

Trouble is I don't posses enough knowledge of DB systems to understand
what is meant by the qualifier and schema parameters, anyone had any
success in this area?

2/ I grant that this doesn't seem to have a solution but I thought
I'd ask just in case... basically I'm looking for an equivalent of
mysql_field_table() but for ODBC. Either that or some way of
determining the source table of a given field from a resultset or even
the original SQL statement.

Any help would be greatly appreciated.

--Phil
Jul 17 '05 #1
1 1890
ph**@openaccess.tv (evilbreadbin) wrote in message news:<a9**************************@posting.google. com>...
Greetings,

My problem consists of two parts, the first of which I imagine is only
a matter of syntax whilst the second might very well be impossible.

I'm not sure if it is of consequence but PHP is running on a Win2000
machine and the ODBC connection in question links to an MS-Access
database.

1/ I am trying to get my head around odbc_columns(). When using the
function in its simple case -- just providing a ODBC link -- all is
fine and it returns a dataset of all the columns in all the tables
fine. The problem is that I cannot ask it to list _all_ the columns
each time and I would like to be able to inspect just one table's
columns. (A major reason for this is that the target database
contains hundreds of tables and so odbc_columns() takes a long time to
complete.)

Trouble is I don't posses enough knowledge of DB systems to understand
what is meant by the qualifier and schema parameters, anyone had any
success in this area?

2/ I grant that this doesn't seem to have a solution but I thought
I'd ask just in case... basically I'm looking for an equivalent of
mysql_field_table() but for ODBC. Either that or some way of
determining the source table of a given field from a resultset or even
the original SQL statement.

Any help would be greatly appreciated.

--Phil


For anybody having similar problems I have now managed to get the
first part of this working. Here is a working example:

<?php
$conn_ODBC = odbc_connect("peopledb", "Admin", "") or die;
$result = odbc_columns($conn_ODBC, "peopledb", "", "people");
odbc_result_all($result);
?>

Where the second param of odbc_columns() is the DNS ODBC link, the
third a zero length string and the forth the table name.

Still don't have a solution to the second part, I'm thinking of doing
a simplistic SQL parser to pull the information directly from the SQL
Statement -- clearly not a preferred solution but it is the only one I
see. Therefore I'd be grateful for any other advice on the matter.

--Phil
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Todd Huish | last post by:
I have noticed something disturbing when retrieving datasets over a relatively slow line (multiple T1). I am looking at about 25 seconds to retrieve 500 rows via a php-odbc link. This same select...
4
by: Phil Latio | last post by:
Scenario is: We have an intranet on which a Helpdesk application can be accessed. Data input into the Helpdesk is stored in a Access 2000 database, held on a server. This is great, works fine,...
10
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
4
by: gege | last post by:
Hi everyone, I'm looking for a C++ ODBC class. Could anybody give me some references ? Thx a lot ! gg ps: - I'm working with MSVC
5
by: Frank Millman | last post by:
Hi all I am using odbc from pywin32 to connect to MS SQL Server. I am changing my program from the old (incorrect) style of embedding values in the SQL command to the new (correct) style of...
4
by: Bob Sanderson | last post by:
I am trying to set up an ODBC DSN to our company MySQL database so that I can use a MS Access front end. I am using the MySQL ODBC 3.51 driver. The database is running off of Apache on our Windows...
2
by: Dale Sampson | last post by:
My app uses an ODBC connection for a .mdb file. I want the app to create the source if it does not already exist (I copy a blank .mdb file to the users data store if it doesn't exist). I see how...
2
by: Greg Corradini | last post by:
Hello All, A few weeks ago, I wrote two scripts using mx.ODBC on an Access DB. Among other things, both scripts create new tables, perform a query and then populate the tables with data in a...
3
by: Laurence | last post by:
Hi there, I know it is possible to develop ODBC program on Windows. Just install DB2 Client, then using Windows ODBC manager to configure. But, is it possible to develop ODBC program on AIX?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
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
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...

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.