LOCK May Fail to Properly Return Error After CHAIN Under OS/2 (68021)



The information in this article applies to:

  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1

This article was previously published under Q68021

SYMPTOMS

Under MS OS/2, the following program demonstrates how a LOCK statement can fail to properly give a "Permission Denied" error for a locked record in a file kept open across a CHAIN. This problem does not occur under MS-DOS.

STATUS

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

MORE INFORMATION

Code Samples

TEST01.BAS

10 ON ERROR GOTO 70
20 OPEN "pippo" FOR RANDOM ACCESS READ WRITE SHARED AS #1 LEN=128
30 LOCK 1, 1
40 CHAIN "TEST02"
70 PRINT ERR; ERL
80 END
				

TEST02.BAS

10 ON ERROR GOTO 70
20 LOCK 1, 1
30 END
70 PRINT ERR; ERL
80 END
				
Compile and link the above programs as follows:
  BC /X/LP test01;
  LINK test01;
  BC /X/LP test02;
  LINK test02;
				
Under MS-DOS, the second (CHAINed) program correctly returns a "Permission Denied" error (error code 70) for the LOCK statement; however, under OS/2, this program fails to give an error.

Modification Type:MajorLast Reviewed:10/20/2003
Keywords:KB68021