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

Storing Word information

Status
Not open for further replies.

OldSmelly

Programmer
Nov 22, 2001
70
NL
Hi All,

Last week ik asked a question what the best way was to store Word information(letters) in a foxpro table.. Up until now I stored it in a general field but this is not the way to go because of the problems with general fields so One person said you could store it in a memo field or as seperate files and store the filename in a table. I think the last option is the best one BUT what kind of map filetructure to use ?

If I store all the doc's in a map let's say in the format
12345.NewLeter.doc where 12345 is the id number I get map with a huge amount of files because there are 100.000 people in my database. So what do you think is the best way to do this because I don't know if windows will have problems with this amount of files in one map ?


Thanks in advance


 

It unclear what the problem is. If you store the path of the file including the filename in a character field for each record, how does that affect how Windows handles it?



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Sorry maybe I wasn't clear enough on this....

The problem might be that If I store the path+filename in a table the underlying map-structure ie "c:\docs" will contain a huge amount of documents upto 100.000-500.000 files and this could be a problem for windows ?
 
OldSmelly

The fact that you have that many documents stored in a directory is unrelated to VFP. Use ShellExecute to open them. But whether it is VFP or another application handling your documents, there isn't much you can do with VFP to make "Windows handle them better".

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
OldSmelly,

Although I would think Windows could handle this number of files, I do question your reasons for wanting to store so many Word documents.

Presumably you have an application which is generating these documents automatically. Also, I assume the information needed to do so is stored in a database. Are you sure you really need to retrieve the actual documents, when the original data is still available? At worst, could you not regenerate a given document if you really did need to access it?

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Mike,

I thoughed of that but the document may not be available anymore (lost) or is changed over time so then this document isn't the same as the one you send .....

Mgagnon,

I know that foxpro isn't capable of making windows better in handling that amount of documents I was just wondering if it could be a problem if that many documents are in in one map
 
FYI: You're confusing everyone with your phrase "in one map"... you really intend to say "in one directory" or "in one folder".

The term "map" is not used to refer to the location one or more files are stored.

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
You may find these references useful:
(It turns out that FAT32 directories can contain up to 65,534 files, and up to 268,435,456 files on a drive
NTFS dirctories have no limit as to the number of files, but the drive is limited to 4,294,967,295 files)



- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
The archived files don't need to be stored in a single directory.

You should/can divide them into sub-folders based on an account or branch number prefix, year of creation etc.

I'd use dynamic path and file naming logic that can be re-created from basic data within the database so that you don't need to explicitly store the path and name of each file.

In addition to that you could zip sets of archived files using SawZip and then auto expand them if needed. See faq184-3830 How to create ZIP Files with VFP and also some additional usage syntax below. e.g. Add an IF lcname=MyTarget...uncompress...ENDIF to extract just one file.

One benefit to the zipping is that (automated) backup gets that much easier.

Brian

Code:
enumzip("test.zip")

PROCEDURE enumzip
LPARAMETERS cZipfile
WAIT WINDOW "GATHERING FILE INFO" NOWAIT
oSAWArchive = CREATEOBJECT("SAWZip.Archive")
oSAWArchive.Open(cZipfile)
oSAWFile = CREATEOBJECT("SAWZip.File")
nFileCnt = 0
FOR EACH oSAWFile IN oSAWArchive.Files
nFileCnt=nFileCnt+1
   lcname=PADR(ALLTRIM(oSAWFile.Name()),20,CHR(32))
   lcComp=PADR(TRANSFORM(oSAWFile.CompressedSize()),20,CHR(32))
   lcUncomp=PADR(TRANSFORM(oSAWFile.UncompressedSize()),20,CHR(32))
   lcMod=PADR(TRANSFORM(oSAWFile.ModificationDate()),20,CHR(32))
?lcname+lccomp+lcuncomp+lcmod
ENDFOR
?TRANSFORM(nFileCnt)+" Total Files"
oSAWArchive.close
oSAWArchive = .NULL.
WAIT CLEAR
ENDPROC
 
y use subfolder:
code: 32333333
dir: \32333\32333333.doc
code: 32343333
dir: \32343\32343333.doc
with this I have a maximun of 1000 doc per dir.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top