Microsoft KB Archive/191315

= BUG: ON ERROR Does Not Trap "Alias Not Found" Error =

Article ID: 191315

Article Last Modified on 5/12/2003

-

APPLIES TO


 * 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

-



This article was previously published under Q191315



SYMPTOMS
Visual FoxPro's ON ERROR command does not trap the following error:

Alias not found error (error 13).



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.



Steps to Reproduce Behavior
Create a program that contains the following code and run the program: SET SAFETY OFF ON ERROR WAIT WINDOW ("FIRST ON ERROR: " + CHR(13) + MESSAGE) CREATE DATABASE Ztest CREATE TABLE Ztest (FirstName C(20), LastName C(20)) USE Ztest EXCLUSIVE INDEX ON LEFT(Ztest.FirstName,6) TAG FIRST6 OF Ztest && Comment this && line. SELECT Ztest USE SET SAFETY OFF ON ERROR WAIT WINDOW ("Second ON ERROR: " + CHR(13) + MESSAGE) USE Ztest ALIAS CLOSE_Ztest SET ORDER TO TAG FIRST6 USE ON ERROR * Clean up and delete files. CLOSE ALL DELETE FILE Ztest.DBC DELETE FILE Ztest.dcx DELETE FILE Ztest.dct DELETE FILE Ztest.DBF Run the program and note that the ON ERROR routine traps the following error:

Variable 'First6' not found.

Next, place an asterisk (*) in front of the INDEX ON command in the code. Run the code again and note that the ON ERROR command does not trap the "Alias not found" error. In addition, the ON ERROR command does not trap error 13 when evoked from the Command window either.

Additional query words: kbVFp300bbug kbVFp500abug kbVFp600bug kbXBase kbvfp300 kbvfp500 kbvfp600

Keywords: kbbug kbnofix kbcode KB191315

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.