Consultor Eletrônico



Kbase P35874: "OUTPUT TO" and "OUTPUT TO PRINTER" generate errors 98 and 4110 respectively if print server is offl
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/5/2007
Status: Unverified

SYMPTOM(s):

"OUTPUT TO" and "OUTPUT TO PRINTER" generate errors 98 and 4110 respectively if print server is offline

** Unable to open file: <file-name>. Errno=<number>. (98)

** Unable to create Printer Device Context: . (4110)

Using correct UNC path and printer name

Printer is not installed on the client machine

Server on which the printer is installed is not available on the network

"OUTPUT TO" does not support the use of NO-ERROR

CAUSE:

"OUTPUT TO" attempts to find a printer that in effect does not exist.

FIX:

There is no way to detect whether or not the print server is online or not using only Progress.

The following code provides a simple workaround:

DEFINE VARIABLE chkPtr AS CHARACTER NO-UNDO.

INPUT THRU VALUE ('net print \\<PCName>\<PrinterName>').
IMPORT UNFORMATTED chkPtr.
INPUT CLOSE.

IF chkPtr = ? OR chkPtr = "" THEN DO:
OUTPUT TO PRINTER \\<PCName>\<PrinterName>.
DISPLAY "HELLO".
OUTPUT CLOSE.
END.
ELSE
MESSAGE chkPtr
VIEW-AS ALERT-BOX INFO BUTTONS OK.