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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FoxPro Memo Field Question

Status
Not open for further replies.

kroenecker

Programmer
Jul 2, 2007
4
US
Is there a size limit to FoxPro Memo field sizes? We currently use FoxPro 6, I believe.

Thanks for your time.
 
As in all versions of Foxpro the physical size of the FPT file (which contains the memo part of your table) is limited to 2gigs as shown the the system limitations of Foxpro in the help file. I don't believe there is an actual limit (other than physical) as to how much a single memo field can contain.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Mike,

Thanks for the quick response. Is their a particular trick to entering a large string into a memo field (a string that is smaller than 2gigs of course)?

Thanks,
Nate
 
Hi.

Memo fields are one of the most discussed areas of VFP.

Many feel they are the devil's spawn!

I quite like them - as long as the limitations are accepted from the beginning.

The first is that the general (blob) types are pretty much useless and it's better to use a binary memo for storing binary data. So, if you must put jpg files in your table, use the filetostr() to do it into a binary memo.

Design your database from the ground up to cope with realistic file sizes. If you are likely to ever exceed 2 GB then design a structure where the memos can be spread across a number of tables (img001, img002 or whatever).

Remember that if you edit a memo field and save it, it will most likely just append to the memo file - rather than reuse the space. So, editting makes things grow - bigtime.

So, if you need to store a companies logo, or a couple of signatures or the text from a few letters - memos are great.

If you are thinking of creating a bulletin board, or a chat room - or a passport system, where the records are edited and updated... think again.

Regards

Griff
Keep [Smile]ing
 
kroenecker

If was really important go beyond the 2 gig limit, take a look at Craig Boyd's excellent compression software, VFPCompression Library

Free, fast, it also has the ability to compress VFP strings so you could compress a string into a memo field and uncompress the string out of the memo field.

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Thanks all for your helpful responses.

Mike,

The only reason I ask is that I'm about to dive into a project involving Foxpro 6, which wouldn't be a big deal except that the other developers in my office are convinced that there is a 500k limit to the size of files that can be inserted into memo fields. I just wanted to feel out whether or not that might be something I actually have to deal with hence the post. From what you are all writing, this shouldn't be the case which is good to hear.

I'm sure I'll have some questions nonetheless.

Thanks,
Nate

 
Nate,

other developers in my office are convinced that there is a 500k limit to the size of files that can be inserted into memo fields.

I don't beleve that's true (although it's been a while since I worked with VFP 6.0).

But why don't you just try it for yourself. It should be easy enough to put together a 500 KB file and try inserting it into a memo field.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hello Nate,

If you plan to store (huge) files into a binary memo field or the like of fields, that in itself is no problem (there is Append Memo <memofieldname> From <filename> to do that and I just tried and managed to do so with a 500 MB (not kb) file), but an update of a memofield will not recycle the used diskspace but append the new value to the fpt file. Therefore binary memos, Blobs or general fields are avoided for this task. General fields have the additional disadvantage, that you can't put the file back to disk without some tricky code.

You can Pack the database from time to time to avoid the memo bloat effect. Still 2GB are filled quite fast with files in the 500k range.

A recommendations therefore is to store paths to files and not the files itself.

If there are reasons to store the files (paths have the disadvantage that they can get broken, if files are moved for example) you can of course create several more dbfs to store more files. It just will take some more effort to query from multiple tables instead of one.

Bye, Olaf.
 
other developers in my office are convinced that there is a 500k limit to the size of files that can be inserted into memo fields.

There is no such limit mentioned in the System Capacities topic of the VFP6 help file. It mentions a 65,500 limit to the number of characters in a record, but a memo field only takes up 4 bytes, so that wouldn't be affected.

I don't remember ever hearing of such a limit.

pamela
 
There was a limit on the size of a memo field in the dBase III and FoxPlus Days.
That Limit was removed with FoxPro 1.0


David W. Grewe Dave
 
Thanks everyone for taking the time to post these replies. I'm still waiting on a few individuals to get back to me about the details of our current system, but I'm sure that I will have more questions in the coming days.

By the way my project has to do with Verifax. I don't know if any of you have experience with Verifax, but it uses Foxpro from what I understand. Anyway, once I know more I'll be back.

Thanks again,
Nate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top