Article ID: 287650 - Last Review: February 12, 2007 - Revision: 3.2

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

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article was previously published under Q287650

On This Page

Expand all | Collapse all

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.


APPLIES TO
  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft Visual FoxPro 3.0b Standard Edition
  • Microsoft Visual FoxPro 5.0 Standard Edition
  • Microsoft Visual FoxPro 5.0a
  • Microsoft Visual FoxPro 6.0 Professional Edition
  • Microsoft Visual FoxPro 7.0 Professional Edition
  • Microsoft Visual FoxPro 8.0 Professional Edition
Keywords: 
kbbug kbcodesnippet kbpending kbprint kbreportwriter KB287650