Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access VFP Tables on Linux?

Status
Not open for further replies.

rlawrence

Programmer
Sep 14, 2000
182
US
Hi folks,

It's been a while, but this seems like the best place to get a fresh answer to an old question: How can I access my VFP data on a Linux server?

My Linux server is running Debian 9, Apache 2, PHP 7, MariaDB, and ODBC.

I have a legacy Foxpro 7 application that I am trying to migrate to this environment. (I'll be converting the database to MariaDB, but that's not pertinent to my question here.) You may also want to know that I am making heavy use of memo fields (.FPT files) and indices (.CDX), but am NOT making use of the database container (DBC).

My immediate problem is that I have a Windows based web application that allows a customer's clients to get reports from their data. All my client has to do is FTP their data to the web site on a periodic basis. I'd like it to be as easy as that in the Linux environment. This implies that I need to be able to read those tables on Linux. I'm trying to ditch the Windows server, and this application is the only thing preventing this from happening.

My Linux environment is making heavy use of ODBC. So, naturally, I have been looking for an ODBC driver for Foxpro. I've done this on Windows, but I'm betting that the VFP driver requires VFP to be installed for it to work. That doesn't seem possible on Linux. I haven't yet found whether a Foxpro driver for ODBC even exists for Linux.

It looks like Microsoft's solution is an ODBC driver for SQL Server, but the driver seems to require installing SQL Server as well. That seems like a lot of trouble for something that I am not confident is going to work. Does anyone here have experience with this?

I have been scouring the internet for other answers. There are many partial answers--including a PHP extension for dBase, but that doesn't support FPT files.

I know some here have been dealing with this question for years. I'm hoping that some new answers are available. Any suggestions would be greatly appreciated.

Thanks in advance,

Ron
 
Hi Ron,

I can't give you a detailed answer (no doubt other forum members can be more helpful). But, first, have you investigated using OLE DB rather than ODBC? There is a (Windows-based) OLE DB driver for VFP, and I'm fairly sure that it does not require VFP to be installed - not even the runtimes.

Also, there is a company called Progress Data Direct that is advertising a Linux-based ODBC driver for VFP. I have no experience of using it, but it might be worth your while to investigate (if you haven't already done so).

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike,

Actually, I have attempted to install Progress DataDirect. I may have to go back to it, but the installation didn't go well. I'm wondering whether I'm having issues because of Debian. I'll work that out with them, but the process has not been smooth. I feel like they have also been a little cagey about the cost.

Is there an OLE DB driver that you know of that runs on Linux?

You know, some of my trouble is because I am still a relative novice in Linux. Just talking to someone with experience here would be a huge help.

Thanks again,

Ron
 
Is there an OLE DB driver that you know of that runs on Linux?

Unforutnately, I don't. I'm not even sure if OLE DB is available outside the Microsoft world. (Can anyone clarify that?) I hope I am not sending you down the wrong path.

The reason I mentioned OLE DB as an alternative to ODBC is that, if I remember rightly, the ODBC for VFP driver only supports DBF files up to version 6.0 of VFP. After that, the file format changed slightly, and the driver was not updated to support it.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
You can forget to use Microsoft VFP ODBC driver or OILEDB Provider, bit install on Windows only and contain a (limited) VFP runtime, this does not run on Linux, so you have to look out for third party drivers usable on Linux.

You can easily use Linux as a file server and let it host DBF files Windows clients then can access via ll the options available, native access, ODBC or OLEDB, but when the access should be made on Linux on a DBF file you get FTPed, then use that.

If I understand this is what is FTPed, otherwise why not FTP in CSV or other data formats. Notice CSV is capable to have Memo (multiline text) content, only VFP lacks the necessary functionality to read such memos in from csv, but you can generate this quite easily, see faq184-7770

Bye, Olaf.

Olaf Doschke Software Engineering
 
Here's another idea - but it is very much a long shot.

The early versions of Foxpro (pre-Visual) and Foxbase were multi-platform, and included Linux (or Unix) versions. In the unlikely event that you could lay your hands on such a product, it would be an easy matter to write a program to read the DBFs and export them to some better-known format, such as CSV.

But that assumes that your data is in FOX2X or earlier format (no new data types, no null support, etc). As I said, very much a long shot.

Or maybe someone has already written a Linux conversion utility to get data out of DBFs.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
OK, here's something that looks more promising:

DBF Viewer and Editor for Linux

Extracts from the above page:

The program supports all kinds of memo fields (dBaseIII, dBaseIV, FoxPro, Visual FoxPro and dBase Level 7),

The most important features are:

Keyboard macros
Multiple files opening
Working with selected cells
Export information to different formats: TXT, CSV, SQL, HTML, DBF
and more...

(Emphasis added).

If you can live with the data being exported rather than accessed directly, this looks like a possibility.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks guys,

New leads to follow up. I'll try to report back if I find something that actually works.
 
If you go for Perl there is Not that I used it, but a competitor. Funnily but not surprising, another legacy language has such modules.

I guess the devart ODBC driver will be it, working for Linux and ODBC, thus usable from PHP.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top