Php reads dbf, but there is no cdx file with the same name as php dbf cdx
PHP reads the dbf file in the folder. if a cdx file with the same name exists, there is no read problem,
However, if you only have an independent dbf file and read it through PHP, the following error is returned ..
$ 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 );
?>
The following error is reported ..
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
Excuse me .. Why? How can this problem be solved ??
Reply to discussion (solution)
Sorry, I just tested another file. only the DBF file is available, but there is no cdx file. you can open it with the same command ..
It is estimated that the problem is not in the cdx file .. What is the problem?
Thank you for your guidance !! It's in a hurry ..
The CDX file is an inline index file of dbf.
If it was deleted later, dbf won't be able to open it.
You can create an empty file to impersonate
Thank you very much for replying so soon.
I tested it, but I still cannot .. The same error is reported ..
What would happen if it wasn't about CDX?
Find the cause .. Because DBF has different file types and different VFP versions, ODBC supports up to 7
Later, the plug-in can be connected using the ADODB and VFP oledb drivers ..