Creates an array containing data from a table open in an instance of Visual FoxPro.
ApplicationObject.RequestData([nWorkArea | cTableAlias] [, nRecords])
- Specifies the work area number of the table from which data is stored in the array. If you omit cTableAlias and nWorkArea, data from the table open in the current work area is stored in the array.
- Specifies the alias of the table from which data is stored in the array.
- Specifies the number of records stored in the array, starting from the current record. If nRecords is omitted and sufficient memory is available, all records, starting from the current record, are stored in the array.
Use the RequestData method to retrieve data from an instance of Visual FoxPro.
The following example, run from within Visual FoxPro, creates a second instance of Visual FoxPro. The Customer table is opened in the second instance of Visual FoxPro.
An array containing data from the Customer table is created in the first instance of Visual FoxPro, and the contents of the array are displayed. The array contains data from the first 5 records in the Customer table. The second instance of Visual FoxPro is then closed.
oNewInstance = CREATEOBJECT('VisualFoxPro.Application') oNewInstance.DoCmd "USE (HOME(2) + 'Data\Customer')" aCustomerArray = oNewInstance.RequestData('Customer',5) DISPLAY MEMORY LIKE aCustomerArray oNewInstance.DoCmd('QUIT')