"Bad Record Number" Using Network Printer in OS/2, LANMAN 2.00 (67313)






This article was previously published under Q67313

SYMPTOMS

When the MS-DOS device "LPT1" or "LPT2" is OPENed to print over a Microsoft LANMAN version 2.00 network printer under OS/2, the error "Bad record number in line <nn> in module <module name> at address xxxx:xxxx" will occur when the device is closed. This error does not occur when printing to a local printer or to a LANMAN 2.00 network printer under MS-DOS.

WORKAROUND

To work around the problem, open the Basic logical device "LPTn:" instead of the MS-DOS "LPTn" device. The following code example will compile and run without error when run under MS-DOS or OS/2, and printing to a local or network printer device:
   OPEN "LPT1:" FOR OUTPUT AS #1
   PRINT "Hello world"
   CLOSE #1
				
NOTE: There is a problem when the Basic device "LPTn:" is opened across two CHAINed programs. For more information, please query on the following words:

CHAIN and device and I/O and LPT1 and LPRINT

STATUS

Microsoft has confirmed this to be a bug in programs compiled with Microsoft Basic Compiler versions 6.00 and 6.00b for MS OS/2 and in Microsoft Basic PDS (Professional Development System) versions 7.00 and 7.10 for MS OS/2. Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following code segment demonstrates the "Bad record number" error when compiled and run under OS/2 with logical device "LPT1:" connected to a Microsoft LANMAN 2.00 network.

NOTE: The code example will compile and run without error when run under MS-DOS or if the logical device LPT1: refers to a local printer.
   OPEN "LPT1" FOR OUTPUT AS #1
   PRINT "Hello world"
   CLOSE #1
				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB67313