Heim  >  Artikel  >  Backend-Entwicklung  >  php 读dbf,但是没同名的cdx文件

php 读dbf,但是没同名的cdx文件

WBOY
WBOYOriginal
2016-06-13 12:42:041022Durchsuche

php 读dbf,但是没有同名的cdx文件
PHP读取文件夹下dbf文件,如果与其同名的cdx文件存在的话,读取没有问题,
但是如果只有独立的dbf文件,通过PHP读取,报错如下。。

$add='c://BatMan//Daten//ladertyp.DBF';
$e="Driver={Microsoft Visual FoxPro Driver};SourceType=DBf;SourceDB=".$add.";";
$odbc=odbc_connect($e,'',''); 
 
echo $add;
$query = "select * from  ".$add.";";

$result_id = odbc_do($odbc, $query);
odbc_result_all($result_id, "border=1 width=50%");
odbc_close($odbc);
?> 

报错如下。。
c://BatMan//Daten//ladertyp.DBF
Warning: odbc_do(): SQL error: [Microsoft][ODBC Visual FoxPro Driver]Not a table., SQL state S0002 in SQLExecDirect in C:\xampp\htdocs\dbf.php on line 9

Warning: odbc_result_all() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\dbf.php on line 10

请问下。。什么原因呢?又该如何解决呢??

php?dbf?cdx
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn