I am trying to figure out how to query some data out of a dbase IV
(.dbf) file sitting on a remote server from my MySQL/PHP/Web Server.
Both servers are Windows Server 2003 SP2.
My MySQL/PHP/Web server is running PHP 4.3.11, MySQL 4.0.24, and IIS.
I have set a system DSN on the remote machine for the directory that
contains the dbase file. The DSN name is SASIxp, and the actual file
I'm trying to connect to is ADST.DBF.
I've found several examples of how to connect with other database
types, and have used those examples in an attempt to connect to my
dbase IV file, but so far, I'm not having any luck. Instead, I'm
getting errors like: - Warning: odbc_exec(): SQL error: [Microsoft][ODBC dBase Driver]
-
The Microsoft Jet database engine could not find the object
-
'ADST.DBF'. Make sure the object exists and that you spell its name
-
and the path name correctly., SQL state S0002 in SQLExecDirect in E:
-
\InetPub\wwwroot\posa_test\includes\functions.inc on line 4952
I'm including my sandbox code below, which includes 4 different
versions of $connection_string, none of which have worked. :(
Does anybody know of a good tutorial, or have any suggestions? I know
I'm somewhat limited in what I can do with a dbase IV file (if
anything???), but all I really need is to do a simple lookup; no
adding, deleting or changing of any records. -
//$connection_string = 'DRIVER={Microsoft dBase Driver
-
(*.dbf)};SERVER=<10.112.139.230>;DATABASE=<ADST.DBF>';
-
//$connection_string = 'DRIVER={Microsoft dBase Driver
-
(*.dbf)};SERVER=<10.112.139.230>;DATABASE=<SASIxp>';
-
-
//$connection_string = 'DRIVER={Microsoft dBase Driver
-
(*.dbf)};datasource=SASIxp;';
-
-
$connection_string = 'DRIVER={Microsoft dBase Driver (*.dbf)};
-
datasource=\\\\sasi_main\\sasixp\\datafile\\ADST.DBF;';
-
-
-
$user = '';
-
$pass = '';
-
-
//$connection = odbc_connect( $connection_string, $user, $pass );
-
-
$odbc = odbc_connect ($connection_string, '', '') or die('Could Not
-
Connect to ODBC Database!');
-
-
$strsql= 'SELECT * FROM ADST.DBF';
-
-
$query = odbc_exec($odbc, $strsql) or die (odbc_errormsg());
Thanks in advance for your assistance!: :) 2 11109
<bc*****@gmail.comwrote in message
news:24**********************************@u10g2000 prn.googlegroups.com...
>I am trying to figure out how to query some data out of a dbase IV
(.dbf) file sitting on a remote server from my MySQL/PHP/Web Server.
Both servers are Windows Server 2003 SP2.
My MySQL/PHP/Web server is running PHP 4.3.11, MySQL 4.0.24, and
IIS.
I have set a system DSN on the remote machine for the directory that
contains the dbase file. The DSN name is SASIxp, and the actual
file
I'm trying to connect to is ADST.DBF.
I've found several examples of how to connect with other database
types, and have used those examples in an attempt to connect to my
dbase IV file, but so far, I'm not having any luck. Instead, I'm
getting errors like:
- Warning: odbc_exec(): SQL error: [Microsoft][ODBC dBase
-
Driver]
-
The Microsoft Jet database engine could not find the object
-
'ADST.DBF'. Make sure the object exists and that you spell its name
-
and the path name correctly., SQL state S0002 in SQLExecDirect in E:
-
\InetPub\wwwroot\posa_test\includes\functions.inc on line
-
4952
I'm including my sandbox code below, which includes 4 different
versions of $connection_string, none of which have worked. :(
Does anybody know of a good tutorial, or have any suggestions? I
know
I'm somewhat limited in what I can do with a dbase IV file (if
anything???), but all I really need is to do a simple lookup; no
adding, deleting or changing of any records. -
//$connection_string = 'DRIVER={Microsoft dBase Driver
-
(*.dbf)};SERVER=<10.112.139.230>;DATABASE=<ADST.DBF>';
-
//$connection_string = 'DRIVER={Microsoft dBase Driver
-
(*.dbf)};SERVER=<10.112.139.230>;DATABASE=<SASIxp>';
-
//$connection_string = 'DRIVER={Microsoft dBase Driver
-
(*.dbf)};datasource=SASIxp;';
-
$connection_string = 'DRIVER={Microsoft dBase Driver (*.dbf)};
-
datasource=\\\\sasi_main\\sasixp\\datafile\\ADST.DBF;';
-
$user = '';
-
$pass = '';
-
//$connection = odbc_connect( $connection_string, $user, $pass );
-
$odbc = odbc_connect ($connection_string, '', '') or die('Could Not
-
Connect to ODBC Database!');
-
$strsql= 'SELECT * FROM ADST.DBF';
-
$query = odbc_exec($odbc, $strsql) or die (odbc_errormsg());
Thanks in advance for your assistance!: :)
The ODBC driver probably doesnt like the UNC path, and wants a local
file.
Check google for this.
Richard.
"Richard" <root@localhostwrote in message
news:47***********************@news.euronet.nl...
>
<bc*****@gmail.comwrote in message
news:24**********************************@u10g2000 prn.googlegroups.com...
>>I am trying to figure out how to query some data out of a dbase IV (.dbf) file sitting on a remote server from my MySQL/PHP/Web Server.
Both servers are Windows Server 2003 SP2.
My MySQL/PHP/Web server is running PHP 4.3.11, MySQL 4.0.24, and IIS.
I have set a system DSN on the remote machine for the directory that contains the dbase file. The DSN name is SASIxp, and the actual file I'm trying to connect to is ADST.DBF.
I've found several examples of how to connect with other database types, and have used those examples in an attempt to connect to my dbase IV file, but so far, I'm not having any luck. Instead, I'm getting errors like:
- Warning: odbc_exec(): SQL error: [Microsoft][ODBC dBase
- Driver]
- The Microsoft Jet database engine could not find the object
- 'ADST.DBF'. Make sure the object exists and that you spell its name
- and the path name correctly., SQL state S0002 in SQLExecDirect in
- E:
- \InetPub\wwwroot\posa_test\includes\functions.inc on line
- 4952
I'm including my sandbox code below, which includes 4 different versions of $connection_string, none of which have worked. :(
Does anybody know of a good tutorial, or have any suggestions? I know I'm somewhat limited in what I can do with a dbase IV file (if anything???), but all I really need is to do a simple lookup; no adding, deleting or changing of any records. - //$connection_string = 'DRIVER={Microsoft dBase Driver
- (*.dbf)};SERVER=<10.112.139.230>;DATABASE=<ADST.DBF>';
- //$connection_string = 'DRIVER={Microsoft dBase Driver
- (*.dbf)};SERVER=<10.112.139.230>;DATABASE=<SASIxp>';
- //$connection_string = 'DRIVER={Microsoft dBase Driver
- (*.dbf)};datasource=SASIxp;';
- $connection_string = 'DRIVER={Microsoft dBase Driver (*.dbf)};
- datasource=\\\\sasi_main\\sasixp\\datafile\\ADST.DBF;';
- $user = '';
- $pass = '';
- //$connection = odbc_connect( $connection_string, $user, $pass );
- $odbc = odbc_connect ($connection_string, '', '') or die('Could Not
- Connect to ODBC Database!');
- $strsql= 'SELECT * FROM ADST.DBF';
- $query = odbc_exec($odbc, $strsql) or die (odbc_errormsg());
Thanks in advance for your assistance!: :)
The ODBC driver probably doesnt like the UNC path, and wants a local
file.
Check google for this.
Richard.
BTW,
if you have setup the datasource correctly, you only have to use its
name in PHP, and user and pass if needed.
The data directory etc. you specify in the DSN.
I found this in the archives here, maybe good starting point:
Datasource name= 'Packlists' , user = '', pass = ''
----------------------------------
$odbc=odbc_connect('Packlists','','');
$q="select * from packlist01;";
$odbcset=odbc_exec($odbc,$q);
odbc_fetch_into($odbcset,$row);
for ($i=1; $i<=odbc_num_fields($odbcset); $i++)
{
$field[odbc_field_name($odbcset,$i)] = $row[($i-1)];
}
odbc_close($odbc);
----------------------------------
Good luck
Richard. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: MLH |
last post by:
I'm running XP. Is it required that a given ODBC driver be
selected or set somehow as a default driver? Look at this...
Here's the error: Error: ODBC call failed...
Datasource not found and no...
|
by: Derek Griffiths |
last post by:
Most of the complicated programs I write are boring applications that
manipulate databases associated with the medical billing program where I
work. The program uses foxpro dbases (version 3) for...
|
by: Zlatko Matić |
last post by:
Hello.
In ODBC Data Source Administrator, there is a tab "Connection Pooling" and
option "PerfMon" Enable/Disable.
Could someone explain the meaning of the option and how it reflects to
Access...
|
by: Durumdara |
last post by:
Hi !
I have a text processor code and I want to put the results to standard
files.
HTML, XML, SQLite - they are ok.
But I want to put these datas to DBF too, because when records are many,...
|
by: yefei |
last post by:
it is very weird
I set the same connection string for ODBC connect to dBase file in
asp.net
and the file is the same, just copied from one PC to another PC
but what happens is that it runs well...
|
by: colmkav |
last post by:
HI, anyone know why this code doesnt work? I am trying to set up the
connect property of a tabledef so that it uses a given login and
password. however once I run it I still need to login when I...
|
by: Robert Hooker |
last post by:
I have installed our .NET application on a system running Microsoft Windows
Vista operating system.
When I run our application, I receive the following error message whenever
it tries to create...
|
by: Salad |
last post by:
I am converting an application from A97 to A2003. I have 2 tables
created by another application as a Foxpro.dbf. The table has no index.
The connect string in A97 is
FoxPro...
|
by: Artem |
last post by:
I'm using dbase MySql with character encoding utf-8. The program is written on C#. IDE - SharpDevelop.
I use odbc to get some string data from dbase, but I get:
either symbols '?' if I don't set...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |