I am not using FoxPro. I am using VBScript and ODBC to extract the data for use in something else entirely.
Deane
Main Topics
Browse All TopicsI have a data store with is a FoxPro "free table directory" (forgive me, I have little experience with FoxPro). It's full of DBF, CDX, and FPT files. My understanding is that the FPT files are the memo fields of the database.
Using ODBC, I can get into the DBF files and pull data without a problem. However, I can't get any of the data in the memo fields. Recordsets retrieved via ODBC have all the fields in the DBF files (I've opened them in Excel and counted the fields), but no memo fields.
How to I reach into the FPT files via ODBC to get this memo data? Do I have to do this explicitly, or can I formulate some SQL and let the ODBC driver handle it?
I'm using the "Microsoft FoxPro VFP Driver".
Deane
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Aha! That's even better.
I think this reference will get you where you want to go.
HOWTO: Add Records with Memo Data Using the Visual FoxPro ODBC Driver
http://support.microsoft.c
Not quite what I need...
You see, the data in the files is maintained by another app. I don't need to insert anything into the data, I just need to get stuff out to do some reporting.
Most of the "tables" in the data folder have three files: tablename.CDX, tablename.DBF, tablename.FPT.
My understanding is that the DBF file is most of the data. I can open this in Excel and look through the rows and the columns. The CDX file are in the indexes, right?
As for the FPT file, this is the memo field field (I'm assuming -- the FPT extension is for "FoxPro Memo Field" according to this: http://filext.com/detailli
So, I have an ODBC connection (done it through OLE DB too -- results are the same), and I get all the data:
sSQL = "SELECT * FROM tablename"
Set rsData = oConn.Execute(sSQL)
Then I loop through all the fields:
For Each oField in rsData.Fields
WScript.Echo oField.Name
Next
There are 26 fields coming back in the recordset -- one for each column in the DBF file when I open it in Excel. However, there are no memo fields, and none of the memo-ish" data that people have entered in the client app. The memo fields are tucked away in that FPT file, and the driver is not returning them in the SQL.
Deane
Are you even getting a blank/empty reference to the memo field back from that loop? IOW, is a field name brought back that correlates to a memo field, but it's empty. Or is there just no memo field reference, empty or otherwise coming back?
It can be too that the memo field file is corrupt, although I have nothing to tell me that is the problem here. It's just I have a request from someone just this minute who has a corrupt fpt file and they want me to repair it for them.
No, not even an empty references. There are 26 columns in the DBF file when I open it in Excel, and I'm getting 26 fields back. Each field name corresponds to a column name in Excel. I'm confident that I'm sucking everything I can out of the DBF file.
The bizarre thing is that I don't even know WHAT fields are in the FPT file. I don't know how many there are or what they're named. I just know that the data has to be in there because users are entering memo data in the client and it's not in the DBF file.
I don't think the FPT file can be corrupt, because the clients still work fine.
Deane
Of the 26 fields, there are really none that are empty or that I can't figure out what they are. There is one called "Record Number" which, it strikes me, could be a key in another table (the FPT file).
Just for giggles, I opened the FPT file in a text editor. Sure enough, all the memo data is sitting there amidst a bunch of binary junk. It's right there, I just can't get it out.
Is there a free trial of FoxPro? I'd like to open it in that program just to see how it looks.
Deane
Unfortunately for you, there is no free trial of FoxPro.
Maybe one of these programs will help:
DBFView
http://www.dbfview.net-sof
DBFView v0.16 beta
http://5star.freeserve.com
Business Accounts
Answer for Membership
by: CarlWarnerPosted on 2004-01-29 at 09:58:25ID: 10227625
Are you actually using FoxPro here or are you using Excel to make ODBC calls to FoxPro data? I suspect you're using Excel and memo fields can be a bit of a pill because they can be so long compared to the length of a standard character field in a FoxPro .dbf. I haven't tried this in a long time but, from what I remember, memo fields that have more than 254 characters in them will present problems.
vfoxpro/do wnloads/up dates/odbc / default.a spx
The latest ODBC driver for VFP is at:
Visual FoxPro ODBC Driver
http://msdn.microsoft.com/