BUG: "Error loading printer driver" with a space in the printer name (287650)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0
  • Microsoft Visual FoxPro for Windows 7.0
  • Microsoft Visual FoxPro 8.0

This article was previously published under Q287650

SYMPTOMS

When you print to a network printer whose share name contains spaces, you may receive the following error message:
Error loading printer driver.
With Visual FoxPro version 3.0b, you receive the following error message:
Printer is not ready.
This error only occurs if multiple printers are installed, and the printer with the space in the share name is not the default printer.

RESOLUTION

To work around this problem, do one of the following:
  • Make the printer with spaces in the share name the default printer.
  • Change the share name so that it contains no spaces.
Note that you may need to quit and restart Visual FoxPro for these workarounds to take effect.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Install a printer on a Microsoft Windows NT version 4.0 Server computer and share the printer. Be sure to use a share name that contains spaces.
  2. Install two printers on a Windows 98 or Windows Millennium Edition (Me) machine: one that has no spaces in the share name, and the printer that you installed in Step 1. Make sure that the printer without spaces in the share name is the default printer.
  3. Create a report with the name TestPrint and add one field. Use TestPrint.TestField for the expression.
  4. Create a program using the following code:
    *!* Q287650: PRB: Error Loading Printer Driver When Printing To A Printer With a Space In The Name
    *!* This code is used to demonstrate the error.
    LOCAL cPrinter
    cPrinter = GETPRINTER()
    IF !EMPTY(cPrinter)
       SET PRINTER TO NAME (cPrinter)
    ENDIF
    
    CREATE CURSOR TESTPRINT (TESTFIELD C(20))
    APPEND BLANK
    REPLACE TESTPRINT.TESTFIELD WITH "This should Print."
    
    REPORT FORM TESTPRINT NOCONSOLE TO PRINTER
    USE
    					
  5. In the Printer dialog box, make sure that you select the printer that has spaces in the name. You receive the error described in the "Symptoms" section.

REFERENCES

(c) Microsoft Corporation 2001, All Rights Reserved. Contributions by Mark Barnard, Microsoft Corporation.


Modification Type:MajorLast Reviewed:2/17/2005
Keywords:kbBug kbCodeSnippet kbpending kbprint kbReportWriter KB287650