Microsoft KB Archive/112567

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft FoxPro for MS-DOS, version 2.6

-

This article contains answers to frequently asked questions about Microsoft FoxPro version 2.6 for MS-DOS. This article is divided into four sections: Installation

Network Issues

Printing Issues

Screens PART 1: INSTALLATION

=
=======

1. Q. I get the error message "Cannot Create \FOXPRO.EXE" during installation. How can I correct this problem?

A. One possible cause is that FOXPRO.EXE or FOXPROX.EXE already exists in that directory and it is marked read-only.

In order for the Setup program to perform a successful installation, you must either rename the .EXE file or mark it as read/write. To      mark the file as read/write, use the MS-DOS command ATTRIB -R \FOXPRO.EXE to remove the Read-Only attribute from the file.

2. Q. What are the minimum files required to run FoxPro?

A. Not all files placed on the hard disk during installation of FoxPro are absolutely required for operation of the product. FoxPro version 2.6 for MS-DOS can be started with only two files: FOXPRO.EXE and FOXPRO.OVL. For the Extended (32 bit) version, these two files can be replaced by only one, FOXPROX.EXE.

The minimum files needed to run FoxPro version 2.6, use the menu and screen generators, and set printer drivers are listed below.

NOTE: Upon startup, FoxPro will create FOXUSER.DBF and FOXUSER.FPT files, and upon screen or menu generation, it will create the appropriate .FXP files.

Filename        Bytes      Comments -      DRIVER2.PLB      13277 FOXSWAP.COM      5971      Only needed for standard version. GENMENU.PRG     49909 GENPD.APP      374351 GENSCRN.PRG    292613 GENXTAB.PRG     29246      Only needed for cross tabulation. PSAPI.PLB       24451 TRANSPRT.PRG   390203      Only needed if you are converting files from 2.0 or want to create cross-platform applications. FOXPRO.EXE     411599 FOXPRO.OVL    1424976

3. Q. A "CRC Error" occurs during Setup. How can I correct this error?

A. When reading a disk, MS-DOS performs a cyclical redundancy check (CRC) to verify disk sectors. The CRC is a sophisticated parity check of the data in each sector and will detect most data errors, such as lost or scrambled bits.

To determine if there is a problem with the disks:

1. Attempt the installation a second time.

2. Install on a "clean" (minimal) configuration.

3. Install on another machine to verify there is not a hardware problem.

4. Copy the floppy disks to a temporary directory on the hard disk and run the Setup program from this temporary directory.

If the installation still fails, call Microsoft Technical Support for assistance.

4. Q. When I'm running the INSTALL /N command, I get the error message "File 'ADDUSER.APP' Does Not Exist." How can I correct this problem?

A. The INSTALL /N command was not issued from the directory containing the Administrative Installation (INSTALL /A) of FoxPro.

After a Workstation Installation completes the Basic portion of its installation, it calls the FoxPro program ADDUSER.APP to configure the workstation for the network environment. In order for FoxPro to      load and run ADDDUSER.APP, the current directory must be the Administrative Installation directory.

Even if the Administrative Installation directory is on the MS-DOS search path, allowing FoxPro itself to start, because ADDUSER.APP is      not an MS-DOS executable program (.COM or .EXE), it cannot be       located on the path, thus causing the error message.

5. Q. The Configuration portion of INSTALL /N fails. How can I correct this problem?

A. The command, "INSTALL /N" (without the quotation marks) was not issued from the directory containing the Administrative Installation (INSTALL /A) of FoxPro.

Go to the drive and directory containing the Administrative Installation of FoxPro, then reissue the INSTALL /N command.

After a Workstation Installation completes the Basic portion of its installation, it calls the FoxPro program ADDUSER.APP to configure the workstation for the network environment. In order for FoxPro to      load and run ADDDUSER.APP, the current directory must be the Administrative Installation directory.

The error received depends on which directory you started INSTALL /N from, and whether you are running it from an MS-DOS prompt in      Windows, or at MS-DOS itself.

6. Q. Why does INSTALL /N prompt for a floppy disk?

A. The INSTALL /N command was not issued from the Administrative Installation directory.

To avoid this problem, use one of the following workarounds.

Workaround 1: Go to the Administrative Installation Directory -

Go to the Administrative Installation directory, and then type the command "INSTALL /N" (without the quotation marks).

For example, assuming the Administrative Installation is located in      a directory named N:\ADMIN, type the following commands at the MS-DOS prompt:

n:         cd\admin install /n

Workaround 2: Use SUBST to Reassign the Letter of the Local Drive -

If for testing or other purposes you require that the Administrative Installation be located on a local hard disk and you do not want to      issue the INSTALL /N command from the Administrative Installation directory, use the MS-DOS SUBST command to reassign the directory containing the Administrative Installation to another drive letter.

For example, assuming the Administrative Installation is located in      a directory named C:\ADMIN and you want to create a Workstation Installation in a directory named C:\WORKSTA, type the following at      the MS-DOS prompt:

subst n: c:\admin c:         cd\worksta n:\install /n

The Workstation Installation requires a previous Administrative Installation. Even though it prompts for a floppy disk, the Workstation Installation cannot be performed using the Installation floppy disks.

PART 2: NETWORK ISSUES

=
=========

1. Q. I get a "File Access Denied" error message when writing to file. How can I correct this problem?

A. The steps you must use to resolve this problem depends on the network product you are using.

For a LANtastic network, do the following:

1. Check the files and locks settings for the SHARE command in the AUTOEXEC.BAT file. The recommended settings are as follows:

share /f:5120 /l:500

NOTE: This command uses a lowercase "L", not a number 1.

2. Verify that the .EXE, .RSC, and .OVL files are marked read-only. If necessary, change the security using the MS-DOS ATTRIB command (for example, ATTRIB +R ).

3. Make sure that the CONFIG.FP file on the server redirects the OVERLAY= statement to a directory other than the directory containing the FOXPRO.EXE file.

For a Novell network, do the following:

1. Check the user's privileges.

2. Have the user log in as a supervisor and repeat the operation.

3. Make sure that the .EXE, .ESO and .ESL files are marked read- only. If necessary, change the security using the MS-DOS ATTRIB command (ATTRIB +R ).

LANtastic and Novell are manufactured by vendors independent of      Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.

2. Q. How do I resolve the "Sharing Violation Reading Drive" error?

A. The following are six troubleshooting steps for this error:

- Verify that each user has a FOXUSER.DBF file.

- Verify that the CONFIG.FP file on the server includes the EXCLUSIVE=OFF statement. If EXCLUSIVE=OFF is used, database files can be shared.

- Verify that the CONFIG.FP file on the server includes the RESOURCE=OFF statement, or that each user's FOXUSER.DBF and FOXUSER.FPT files are marked read-only.

- If you are using FoxPro version 2.6 for MS-DOS, verify that the FOXPRO.EXE, FOXPROX.EXE, and FOXR.EXE files are marked read-only.

- If you use the Distribution Kit to create a stand-alone application, verify that the .EXE files are marked read-only.

- If you create compact executable files, mark the .ESL and .ESO files read-only.

- In some cases, the MS-DOS SHARE program must be loaded on the server and on each workstation. Specify the /F and /L parameters as follows:

share /f:5120 /l:500

NOTE: This command uses a lowercase "L", not a number 1.

PART 3: PRINTING ISSUES

=
==========

1. Q. How do I start a print job from a page other than page 1?

A. To start a print job at a location other than page 1, set _PBPAGE to      the number of the page at which printing should start and create a       program that uses the PRINTJOB ... ENDPRINTJOB commands.

Using the _PBPAGE variable to specify the page number where a print job starts does not work outside the PRINTJOB ... ENDPRINTJOB structure.

For example, suppose your printer jammed on page 75 of a 100-page report and all output from page 75 through 100 was lost. The code to      re-create the last 25 pages is as follows:

_PBPAGE=75 PRINTJOB REPORT FORM C:\FOXPRO2\test.FRX ; ENVIRONMENT PDSETUP TO PRINT ENDPRINTJOB

If you wanted to print only page 75, then set "_PBPAGE=75" and "_PEPAGE=75" in the previous example.

2. Q. I am having problems printing labels on a laser printer without using a printer driver. How can I correct this problem?

A. Printing labels to a Hewlett-Packard (HP) laser printer without using a printer driver requires that certain escape codes be sent to      the printer before the command to print the labels. \* \* MSINTERNAL: Specific Avery Label size information should remain \* MSINTERNAL and not for PUBLIC viewing. \* \* For example, Avery 5161 or 5261 labels measure 1-by-4 inches. One page \* of labels has two columns of ten labels each.

To print a label type of 1- by 4-inch labels contained on a two column by ten row label sheet, execute code similar to the following:

SET PDSETUP TO         ??? CHR(27)+'E'       && Reset ??? CHR(27)+'&l8.00C' && Line height 8/48" (LPI 6)          ??? CHR(27)+'&l3E'     && Top margin 3 lines          ??? CHR(27)+'&l56P'    && Page length 60 lines          LABEL FORM TO PRINTER          SET PRINTER TO

NOTE: The escape code lines that contain an ampersand (&) use a      lowercase "L", not a number 1.

In the label generator, use the following settings:

Margin - 3 Width - 34 Number across - 2 Height - 6 Lines between - 0

The above settings are only an example and may need to be modified for specific labels, printers, and applications. For exact escape code sequences, see your printer's manual.

3. Q. I get the error message "Cannot Write to Read-Only File" when printing a report. How can I correct this problem?

A. Given the following circumstances, the error message "Cannot Write      to a Read-Only File" will occur when you try to print a report from within an application (.APP) or an executable (.EXE) program:

- The resource file is included in the project.

- The resource is set to the included filename.

- The REPORT FORM PDSETUP TO PRINT or LABEL FORM PDSETUP TO PRINT command is issued.

There are two ways to avoid this problem:

- Remove PDSETUP from the command.

-or-

- Mark the resource file as excluded and ship it along with the .APP or .EXE file.

4. Q. I get an extra blank line when printing labels. How can I correct this problem?

A. This behavior existed in dBASE III and FoxBASE. It was changed in      FoxPro version 1.02. However, to maintain compatibility with the large installed base of Xbase applications, a design decision was made to revert to the original behavior.

To work around this behavior, print the label form to a file, open the file with low-level file functions, remove the carriage return/linefeed (CR/LF) characters and send the file to the printer using the MS-DOS COPY command. For example:

* Set the number of lines printed per page and print to a file. _PLENGTH=56 LABEL FORM ENVIRONMENT PDSETUP TO FILE temp.txt

* Open file and replace the CR/LF pair with null characters. filehand=FOPEN('temp.txt',2) =FGETS(filehand) =FSEEK(filehand,-2,1) =FWRITE(filehand,chr(0)+chr(0)) =FCLOSE(filehand)

* Copy the file to printer and prevent the appearance of the * MS-DOS screen. HIDE WINDOW SAVE ALL RUN COPY temp.txt LPT1 > NUL SHOW WINDOW ALL

5. Q. I have NewPage and ResetPage enabled in my data grouping, but my       page numbering is not reset to 1. How can I correct this problem?

A. The report has a Bottom Margin setting greater than 0 (zero).

Set Bottom Margin to 0 and add the necessary lines to the Page Footer band. For example, if Bottom Margin is set to 2, reset it to      0 and add two lines to the Page Footer band.

6. Q. I get the error message "File [""] Does Not Exist" when printing on a LAN Manager network. How do I correct this problem?

A. When the program attempts to open a file, it looks in a particular directory. If it does not find the file there it tries other directories until the file is found. When LAN Manager's "chartime" timer (which defaults to 250 milliseconds) expires, it sends a spool close message to the workstation, and if the program is in the middle of a search for the next file to open, the program exits incorrectly with the error mentioned above.

If the chartime parameter in the LANMAN.INI file for the workstation is set to a sufficiently high value, the program will not be      interrupted by the spool close message and will work correctly.

In LAN Manager version 2.1, the chartime parameter controls the amount of time the spooler waits for additional print data before closing the current spool file and printing it. In earlier versions of LAN Manager, this parameter controls the amount of time to wait for pipe data or comm queue data.

For more information about the chartime parameter and the LANMAN.INI file, refer to the LAN Manager documentation or contact Microsoft LAN Manager Technical Support.

See also page 225 in the Microsoft LAN Manager "Administrator's      Reference" for version 2.1.

PART 4: SCREENS

=
==

1. Q. How do I coordinate Browse windows with screens?

A. Page D2-96 of the FoxPro for Windows "Developer's Guide" and page D2-90 of the FoxPro for MS-DOS "Developers Guide" give samples for coordinating Browse windows with screens; however, the SAVE clause has been omitted from the examples. If the optional BROWSE parameter SAVE is omitted, the Browse window will close as soon as any other object is clicked.

To avoid this behavior, change the code examples as follows:

IF NOT WVISIBLE("Client List") BROWSE NORMAL NOWAIT NODELETE LAST TITLE "Client List" ; NOAPPEND NOMENU SAVE FIELDS company ; WHEN showgets ENDIF

IF NOT WVISIBLE("Account Details") SELECT details BROWSE NORMAL NOWAIT NODELETE LAST TITLE "Client List" ; NOAPPEND NOMENU SAVE ; FIELDS ; Trans_type:10, ; Trans_date:10, ; Amt:7,Service SELECT clients ENDIF

2. Q. How can I page through a format file that contains a READ command?

A. Pressing the PAGE UP and PAGE DOWN keys skips one record at a time, forward or backward, in the database and also refreshes the GETs on      the screen.

You can place objects on different pages or different screens by      placing a READ command in the format file. The READ command should be placed after the last GET that would appear on each screen. The following format file example places two objects on the first screen and two more on the second screen. To display the objects that are on the next screen, press the PAGE UP or PAGE DOWN key.

@5,1 GET @6,1 GET READ @5,1 GET @6,1 GET

3. Q. The Cycle command does not work for desktop screens. How can I      correct this?

A. The Cycle command on the Window menu is designed to switch between windows defined on the desktop. When a screen set contains several windows and a desktop screen, Cycle stops on the desktop screen. This is normal behavior, since the Cycle command is intended to be      used with window screens, not the desktop.

To work around this behavior, define a window with no borders instead of using a desktop screen. This will produce a window that looks like the desktop.

The Cycle command is used for cycling through window screens in a      screen set or windows defined on the desktop. The shortcut key CTRL+F1 can also be used to cycle through windows on the desktop. Additional query words: FoxDos Q&A novel

Keywords         : Version          : 2.60 Platform         : MS-DOS Issue type       :
 * }