Microsoft KB Archive/132726

= How to Enumerate and Open All Tables in a Database Container =

Article ID: 132726

Article Last Modified on 2/15/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q132726



SUMMARY
This article shows by example how to use the ADBOBJECTS function in a program to determine the names of all tables contained within a database container (.DBC file), and then use the resulting array to open all tables.



MORE INFORMATION
The following program creates an array (laTableNames) containing the names of all the tables in the Tastrade.dbc sample database container. The FOR loop then opens each table in its own work area. The name of each table is displayed in the upper-right corner of the screen as it is opened.

Code Sample
** Begin Code Example CLOSE ALL OPEN DATABASE c:\vfp\samples\mainsamp\data\tastrade lnNumOfTables = ADBOBJECTS(laTableNames, "Table") FOR i = 1 to lnNumOfTables WAIT WINDOW "Opening Table " + laTableNames(i) TIMEOUT 2 USE laTableNames(i) IN 0 ENDFOR SET VIEW ON
 * End Code Example

Additional query words: VFoxWin

Keywords: KB132726

-

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

© Microsoft Corporation. All rights reserved.