The information in this article applies to:
SYMPTOMSWhen you requery a view multiple times or when you use a table multiple times under a different alias the following error message appears:
CAUSEThe Visual FoxPro name table has overflowed. RESOLUTION
The workaround varies depending on the scenario in which the error message
is received.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This has been corrected in Visual FoxPro 6.0. MORE INFORMATION
The error number for the error message "Too many names used" is error
number 1201.
As a program was being loaded or a table was being opened, the Visual FoxPro name table overflowed. Divide the program into smaller modules.This error can also be received when requerying a view many times or when using a table again multiple times with a different alias each time. The Steps to Reproduce Behavior section below shows two situations that can cause the error to occur. When a variable is declared in Visual FoxPro or a table is opened an entry is made in the Name Table Index for the variable or table field's names. This name table index has a limit of approximately 65,000 entries. This is also the limit on the number of variables, arrays, and array elements that can be used in Visual FoxPro. The name table index can be packed (by Visual FoxPro internally, not users of Visual FoxPro) to eliminate variables and other information that is no longer being used, but this is set to happen only when Visual FoxPro is low on memory, not when the maximum number of entries in the table is being approached. Consequently, the error message occurs when a large number of requeries or when a table is opened multiple times with a different alias each time. Each requery or use of a table is making additional entries in the name table index. Steps to Reproduce BehaviorThe following are two different scenarios that can cause the error message. These programs have been optimized and set up to handle the error. In actual practice, Visual FoxPro may become unresponsive or even crash when the error is encountered.Scenario 1 - Using a Table Multiple Times With a Different AliasPlace the following code into a program file and run the program. The program creates a database and table named "test" and a view named "test_view". The numbers that are output to the Visual FoxPro screen (10000, 20000, 30000, and so forth) are the count of the number of times that the program has gone through the loop. They are shown only at 10,000 increments to speed up the program. When the error is encountered, an ON ERROR routine outputs the number of times the table has been used again, the error number and the error message.At the end of the ON ERROR routine, there are two blocks of code. The first, which is remarked out at present, allows the program to continue after receiving the error. The program closes all tables, which packs the name table index, and then reopens it and goes back into the loop. The second block of code just ends the program after setting SAFETY back to its original state. This code should take about five minutes or less to run, depending on the speed of the computer. Outputting additional information to the screen or turning TALK on slows it down considerably.
Scenario 2 - Requerying a View Multiple TimesIf you are using Visual FoxPro 5.x, place the code below into a program file and run the program. This program uses the Testdata database found in the \Samples\Data folder. The program does not specify any paths so SET DEFAULT TO this directory and save the program there before running the program.The code creates a local view on the employee table from Testdata. It then requeries the view repeatedly in a loop. When the error is finally encountered an ON ERROR routine is invoked. The output is similar to the program in Scenario one. This program also takes a good deal longer to run than the one in Scenario one. The program does not fail until over 100,000 requeries. Usually it fails in the 105,000 to 110,000 range. The sample program below behaves so badly in Visual FoxPro 3.x for Windows that it is probably not even worth running the program. In Visual FoxPro for Macintosh, the following program encounters additional problems. First, the memory allocated to Visual FoxPro should be increased to 10,000. When the code is run, instead of getting the "Too many names used" error, error 43 "There is not enough memory to complete this operation" is returned by the ON ERROR routine. Prior to the ON ERROR routine reporting the error though, the informational message "Memory is low, so streaming output updating has been disabled" displays. If the memory allocated to Visual FoxPro for Macintosh is not increased and the default 6,000 is used, the ON ERROR routine may not have enough memory to even display the error. All this fails after just over 20,000 times through the loop.
Additional query words: kbvfp600fix
Keywords : kbMAC kbVFp FxprgMultiuser FxprgTable |
Last Reviewed: August 18, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |