PRB: Insufficient Memory in FoxPro for Windows on Fast ComputersID: Q171047
|
Working programs in FoxPro 2.x fail with the error "Insufficient Memory" when run on newer, faster computers with clock speeds greater than 150 MHz. This problem applies to both screens with list boxes and queries, but this
article addresses only the problem with FoxPro screens.
The "Insufficient Memory" error message may also occur while in Filer when
changing to a local(not network) directory which contains a large number of
files.
The failure also happens on both MMX and non MMX Computers. The
operating system could be Windows 3.x, Windows for Workgroups 3.x,
Windows 95 or Windows NT. This error does not occur in FoxPro
For MS-Dos.
The current fast computers were not available for testing when FoxPro 2.x for Windows was initially released. Microsoft FoxPro for Windows, 2.x does not always work with list boxes populated from tables with more than 600 records.
At this time Microsoft does not have a good workaround; however, the
following are options to consider:
COPY TO ARRAY aTableField FIELDS charval
RELEASE ALL LIKE aTableField
MEMLIMIT = 60,2048,4098
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
Use the Microsoft Knowledge Base at the following URL to troubleshoot other potential causes of the "Insufficient memory" errors:
http://www.microsoft.com/support/NOTE: Verify that the error is due to the processor speed by trying the code on both a fast and slow computer.
* Sample code to create and populate a large table to test your
* program.
* Environment area.
CLEAR
CLOSE DATABASES
CLEAR SCREEN
* Create a large table
CREATE TABLE LarTable (CharVal C(20), NumVal N(9))
USE LarTable.DBF
* NumRecords = the number of record to be put in the table.
NumRecords= 2000
* Note using larger numbers can take a long time.
NumWide = LEN(ALLTRIM(STR(NumRecords)))
* FOR LOOP to fill the table.
FOR x = 1 TO NumRecords
CharString="Record "+PADL(ALLTRIM(STR(x,numwide,0)),NumWide,"0")
INSERT INTO LarTable (CharVal,NumVal) VALUES(CharString, x)
? RECNO()
ENDFOR
CREATE SCREEN LarTable.scx NOWAIT
DELETE ALL FOR RECNO > 600
(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Mike Fernald, Microsoft Corporation.Additional query words: foxwin fpw MMX
Keywords : FoxWin FxenvGeneral
Version : WINDOWS:2.6,2.6a
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: June 28, 1999