Php reads the dbf files generated by vfp8.0 and 9.0.

Source: Internet
Author: User
Tags sql error
Php reads the dbf file VFP 9.0 generated by vfp8.0 and 9.0 PHP odbc

Thank you for your guidance...

The built-in Tabel Type> autoinc field or Blob field is a DBF file manufactured by VFP8.0 or later. do you want to read it through PHP?
The code is as follows:
$ Add = 'C: // BatMan // Daten // ladert2.dbf ';
$ E = "Driver = {Microsoft Visual FoxPro Driver}; SourceType = DBf; SourceDB = ". $ add. "; Exclusive = NO; collate = Machine; NULL = NO; DELETED = NO; BACKGROUNDFETCH = NO ;";
$ 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 );
?>

Error reported
C: // BatMan // Daten // ladert2.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 7

File structure:


The ODBC driver is installed and then read in 8. 0 is the previous DBF file feasible, but there is no solution for the latest? Is the online odbc driver only for the old version?
I don't know what the best strategies are for the great gods?


Reply to discussion (solution)

Supplement...
Operating Environment: Apache 2.4.3, PHP 5.4.7, VFP 9.0, and ODBC driver .. Vfpodbc_German Version 1.0

Brother ?, Are you using PDO ?? ??

However, thank you for your reply ..
I have never touched on PDO before ..

I later tried to install the VFPOLEDB driver, and then used the adodb for link. some can connect to the returen value which is 0.3.48.50, but the autoinc field in 49 still does not work ..

The problem is fixed .. I found that I didn't start the COM + service in the Window service ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.