Article ID: 181144
Article Last Modified on 5/12/2003
As a program was being loaded or a table was being opened, the Visual FoxPro name table overflowed. Divide the program into smaller modules.
***Start of program***
CLEAR
SET TALK OFF
lcSafe=SET("SAFETY")
SET SAFETY OFF
ON ERROR DO endprog WITH view_count, ERROR(), MESSAGE()
CLOSE DATABASES ALL
CREATE DATABASE 'Test.dbc'
***** Table setup for TEST *****
CREATE TABLE 'Test.dbf' NAME 'TEST' (TESTF1 C(10) NOT NULL)
***************** View setup for TEST_VIEW ***************
CREATE SQL VIEW "TEST_VIEW" ;
AS SELECT * FROM test!test
****
=DBSetProp( 'TEST_VIEW', 'View', 'UpdateType', 1 )
=DBSetProp( 'TEST_VIEW', 'View', 'WhereType', 3 )
=DBSetProp( 'TEST_VIEW', 'View', 'FetchMemo', .T. )
=DBSetProp( 'TEST_VIEW', 'View', 'SendUpdates', .F. )
=DBSetProp( 'TEST_VIEW', 'View', 'UseMemoSize', 255 )
=DBSetProp( 'TEST_VIEW', 'View', 'FetchSize', 100 )
=DBSetProp( 'TEST_VIEW', 'View', 'MaxRecords', -1 )
=DBSetProp( 'TEST_VIEW', 'View', 'Tables', 'test!test' )
*! Field Level Properties for TEST_VIEW.
* Props for the TEST_VIEW.testf1 field.
=DBSetProp( 'TEST_VIEW.testf1', 'Field', 'KeyField', .F. )
=DBSetProp( 'TEST_VIEW.testf1', 'Field', 'Updatable', .T. )
=DBSetProp( 'TEST_VIEW.testf1', 'Field', 'UpdateName', ;
'test!test.testf1' )
CLOSE DATABASES ALL
OPEN DATABASE Test.dbc
USE test SHARED
INSERT INTO test (testf1) VALUES ("abc")
INSERT INTO test (testf1) VALUES ("def")
INSERT INTO test (testf1) VALUES ("hij")
INSERT INTO test (testf1) VALUES ("xyz")
view_count = 0
DO WHILE view_count<100000
view_count = view_count + 1
view_name = "tempviewname" + ALLTRIM(STR( view_count ))
IF MOD(view_count,10000)=0
? view_count
ENDIF
SELECT 0
USE test AGAIN ALIAS ( view_name )
SELECT ( view_name )
USE
ENDDO
PROCEDURE endprog
PARAMETERS view_count, errnum, errmsg
? "The view_count variable's value is " + LTRIM(STR(view_count))
? "Error number: " + LTRIM(STR(errnum))
? "Error message: " + errmsg
**Use this code to get past the error.
*CLOSE TABLES ALL
*USE test
*RETRY
**Use this code to end the program after the error.
CLOSE DATABASES ALL
SET SAFETY &lcSafe
ON ERROR
CANCEL
***End of program***
***Start of program***
CLEAR
CLOSE DATABASES ALL
SET TALK OFF
SET SAFETY OFF
OPEN DATABASE testdata
***************** View setup for EMPVIEW ***************
CREATE SQL VIEW "EMPVIEW" ;
AS SELECT Employee.emp_id, Employee.last_name, ;
Employee.first_name, Employee.title, Employee.city FROM ;
testdata!employee
****
=DBSetProp( 'EMPVIEW', 'View', 'UpdateType', 1 )
=DBSetProp( 'EMPVIEW', 'View', 'WhereType', 3 )
=DBSetProp( 'EMPVIEW', 'View', 'FetchMemo', .T. )
=DBSetProp( 'EMPVIEW', 'View', 'SendUpdates', .F. )
=DBSetProp( 'EMPVIEW', 'View', 'UseMemoSize', 255 )
=DBSetProp( 'EMPVIEW', 'View', 'FetchSize', 100 )
=DBSetProp( 'EMPVIEW', 'View', 'MaxRecords', -1 )
=DBSetProp( 'EMPVIEW', 'View', 'Tables', '' )
*! Field Level Properties for EMPVIEW
* Props for the EMPVIEW.emp_id field.
=DBSetProp( 'EMPVIEW.emp_id', 'Field', 'KeyField', .F. )
=DBSetProp( 'EMPVIEW.emp_id', 'Field', 'Updatable', .F. )
=DBSetProp( 'EMPVIEW.emp_id', 'Field', 'UpdateName', ;
'testdata!employee.emp_id' )
* Props for the EMPVIEW.last_name field.
=DBSetProp( 'EMPVIEW.last_name', 'Field', 'KeyField', .F. )
=DBSetProp( 'EMPVIEW.last_name', 'Field', 'Updatable', .F. )
=DBSetProp( 'EMPVIEW.last_name', 'Field', 'UpdateName', ;
'testdata!employee.last_name' )
* Props for the EMPVIEW.first_name field.
=DBSetProp( 'EMPVIEW.first_name', 'Field', 'KeyField', .F. )
=DBSetProp( 'EMPVIEW.first_name', 'Field', 'Updatable', .F. )
=DBSetProp( 'EMPVIEW.first_name', 'Field', 'UpdateName', ;
'testdata!employee.first_name' )
* Props for the EMPVIEW.title field.
=DBSetProp( 'EMPVIEW.title', 'Field', 'KeyField', .F. )
=DBSetProp( 'EMPVIEW.title', 'Field', 'Updatable', .F. )
=DBSetProp( 'EMPVIEW.title', 'Field', 'UpdateName', ;
'testdata!employee.title' )
* Props for the EMPVIEW.city field.
=DBSetProp( 'EMPVIEW.city', 'Field', 'KeyField', .F. )
=DBSetProp( 'EMPVIEW.city', 'Field', 'Updatable', .F. )
=DBSetProp( 'EMPVIEW.city', 'Field', 'UpdateName', ;
'testdata!employee.city' )
CLOSE TABLES ALL
USE employee
lncount = 0
llworking = .T.
ON ERROR DO reporterr WITH lncount, ERROR(), MESSAGE()
USE EmpView IN 0
DO WHILE llworking
lncount = lncount + 1
=REQUERY( 'EmpView')
IF MOD(lncount,10000)=0
? lncount
ENDIF
ENDDO
PROCEDURE reporterr
PARAMETERS lncount, errnum, errmsg
? "The value of the lncount variable is "+LTRIM(STR(lncount))
? "The error number is: "+LTRIM(STR(errnum))
? "The error message is: "+errmsg
llworking = .F.
ON ERROR
SET SAFETY ON
CANCEL
ENDPROC
***End of program***
Additional query words: kbvfp600fix
Keywords: kbbug kbfix kbpending KB181144