Microsoft KB Archive/287650

= BUG: &quot;Error loading printer driver&quot; with a space in the printer name =

Article ID: 287650

Article Last Modified on 2/12/2007

-

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

-



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.



Steps to Reproduce Behavior
 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. 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. Create a report with the name TestPrint and add one field. Use TestPrint.TestField for the expression.  Create a program using the following code: *!* Q287650: PRB: Error Loading Printer Driver When Printing To A Printer With a Space In The Name LOCAL cPrinter cPrinter = GETPRINTER IF !EMPTY(cPrinter) SET PRINTER TO NAME (cPrinter) ENDIF
 * !* This code is used to demonstrate the error.

CREATE CURSOR TESTPRINT (TESTFIELD C(20)) APPEND BLANK REPLACE TESTPRINT.TESTFIELD WITH &quot;This should Print.&quot;

REPORT FORM TESTPRINT NOCONSOLE TO PRINTER USE  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 &quot;Symptoms&quot; section.</ol>

<div class="references_section">