This project is read-only.

Support for memory fields (SAVE TO/RESTORE FROM)

Oct 6, 2010 at 11:12 PM

I have a SQL database with values saved into text columns through VFP using the SAVE TO command. I've been looking around for any open source implementation of a parser for this format and I was curious if you have any plans to support these special fields. If so it would give me an absolute incentive to use your LINQ to VFP provider. If not then maybe you could give me some direction on where I might be able to investigate how to read this format as well as the VFP .mem file format which I believe is very similar if not identical.

Thanks in advanced!

Oct 11, 2010 at 12:50 PM

I don’t understand what you are asking.  If you are using a SQL database or a .mem file then LINQ to VFP isn’t going to be of use to you because it only works with VFP tables.

Can you give an example of what you are trying to get done?

Oct 11, 2010 at 2:08 PM

Well the main situation I'm dealing with is a SQL database with some data stored in text columns where the SAVE TO command was used in VFP to store variable state. The string is almost identical to what I find in .mem files created with the same version of VFP (9 SP2) with the exception of being in some other encoding which I'm still playing around with. Fortunately however I've been able to write a parser to parse most if not all parts so my problem is solved for the most part.

As far as LINQ to VFP is concerned, maybe you would be of interest in using some of this code in order to parse memo fields in foxpro DBFs that contain variable data. This can normally be detected by the 0x4d 0x0f prefix within the field so it can be detected at runtime when the data is encountered or a utility method could be exposed to allow the developer call it themselves. In my implementation I'm currently using both a Reader approach to return each variable at a time and also I have a utility method which turns a complete memvar encoded stream into a generic Dictionary<string,object> which holds name value pairs representing the underlying variables. Let me know if your interested in the code and if possible I'll make it available for use/modification.