Link to DBF in PHP

Source: Internet
Author: User
Tags php server sql error
PHP connection DBF PHP DBF LAN

Install the ODBC driver on the local computer and link the PHP file to the DBF file ..

If the file is stored on a local disk, enter c: \ BatMan \ Daten \ histwech. dbf,
However, if you want to link the DBF file on other computers in the LAN, how should we define the absolute path of this file?

Thank you for your guidance ..

PS .. the last time someone wrote \ pc69 \ c $ \ xxx. dbf is ineffective. PC69 is the name of the computer in the LAN. Should we use the name or IP address? Why can't I use this method to connect to a local disk .. Assume the local name is pc70.. if this is the case
$ Add = '\ pc70 \ c $ \ BatMan \ Daten \ histwech. dbf ';
The following error is reported:> Warning: odbc_connect () [function. odbc-connect]: SQL error: [Microsoft] [ODBC Visual FoxPro Driver] Fox Error 1, SQL state S1000 in SQLConnect in C: \ AppServ \ www \ batman \ batmanliste. php on line 34

Warning: odbc_exec (): supplied argument is not a valid ODBC-Link resource in C: \ AppServ \ www \ batman \ batmanliste. php on line 132
Please explain ..


Reply to discussion (solution)

Check out the source code of your linked file ??

$ Add = '\\\\ 192.168.1.70 \ c $ \ BatMan \ Daten \ histwech. dbf ';
$ E = "Driver = {Microsoft Visual FoxPro Driver}; SourceType = DBf; SourceDB = ". $ add. "; Exclusive = No; NULL = NO; Collate = Machine; BACKGROUNDFETCH = NO; DELETED = NO ;";
$ Odbc = odbc_connect ($ e ,'','');

The sub-IP address of the local machine is 192.168.1.70. The local disk is c or D .. This is all possible ..

However, in a LAN, for example, PC69, the IP address is 192.168.69 and the disk is C ..
In this case, you cannot write $ add = '\\\ 192.168.1.69 \ c $ \ BatMan \ Daten \ histwech. dbf ..

Then, I connected the LAN on my computer and created \ PC69 \ C as Y: then try to add $ add = '\\\\ 192.168.1.70 \ Y $ \ BatMan \ Daten \ histwech. dbf'; that's not the case...

Please help me ..

Same resource positioning:
// Host name/share name/path/file name
Or
// IP/share name/path/file name

Your original C $ is assumed that the C disk is not explicitly shared, and the default share name is directly used.
You can use it in command line or vfp, but it may not be used in php.
This depends on the switch status during php compilation.

You may need to create an ODBC data source for dbf on another machine on the php server.


I cannot understand what you said ..
It's an emergency ..

What is the same resource positioning? What is the sharing name ??
What if I have to use PHP to connect? What should I do?

I just want to read dbf files from other machines in the LAN, and my errors are OK on odbc_connect. However, an error is reported when an SQL statement is read! In addition, files cannot be found, so I think there should be an error in SourceDB's writing .. But I can't write it.

Please introduce it!

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.