How to Distribute a Large Database with an ApplicationLast reviewed: October 18, 1996Article ID: Q119284 |
The information in this article applies to:
SUMMARYIt is often desirable to ship large databases with applications. However, the Setup Wizard is not designed to split large files and may not be able to compress large database files, possibly resulting in the error message "Incorrect number of bytes written to disk - source file or destination disk may be corrupted - use ChkDsk." To work around the size limitations of the Setup Wizard, you can use a number of third-party compression utilities, such as PKZIP, LHARC, StuffIt, and so on, to compress large database files. Many of these compression utilities are available on bulletin board services. This article demonstrates how to use one of these utilities, PKZIP, to compress a large database so that it can be shipped with an application.
MORE INFORMATIONTo ship a large database with your application, compress the database file, convert it to a self-extracting executable file, and then execute some code to expand (decompress) the compressed file. For example, suppose you want to compress the files PICFILES.DBF and PICFILES.FPT. If you are using PKWare's PKZIP utility, you can compress these files into a self-extracting executable file named PICDBF.EXE by typing the following commands at the MS-DOS command prompt:
PKZIP picdbf picfiles.dbf PKZIP picdbf picfiles.fpt ZIP2EXE picdbfMove the newly-created PICDBF.EXE file to your source files directory. Do NOT put the PICFILES.DBF or PICFILES.FPT file in this directory. Add the following code to the first program in your project:
* This code assumes the data file to be extracted is named * PICFILES.DBF. The example tested for this article was over 5 MB, * and compressed to 1.3 MB. The K value of 240 used in the RUN * command is an empirical value that has proven successful in our * tests, but your results may vary. A lower value may be possible. IF !FILE('picfiles.dbf') OR !FILE('picfiles.fpt') * The data is shipped as a self-extracting executable with the * name PICDBF.EXE. It may be wise to include the -o parameter to * overwrite files when extracting databases. RUN /240 picdbf.exe -o * The WAIT window below will keep FoxPro from continuing in * multithreaded operating systems such as Microsoft Windows NT. DO WHILE !FILE('picfiles.fpt') WAIT WINDOW 'Extracting files...' TIMEOUT 5 ENDDO ENDIFIMPORTANT: The compression software that you decide to use may require additional licensing for distribution in a commercial application. Contact the compression vendor for licensing details. The file-compression utilities mentioned above are manufactured by vendors independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.
|
Additional reference words: 5.00 FoxMac FoxDos FoxWin 2.50 2.50a 2.50b
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |