INFO: Cursors and the Data Environment on Forms and Reports (130298)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q130298

SUMMARY

When you add a table or view to the data environment of a form or report in Visual FoxPro, you may notice that the table is referred to as a cursor. This may be confusing for developers who are accustomed to the version 2.x definition of a cursor as a temporary table.

MORE INFORMATION

The cursor referred to in the data environment is a "cursor object." By adding the table or view as an object, you gain several advantages. During design time, you can specify values for several properties including Exclusive, Alias, ReadOnly, NoDataOnLoad and others. By modifying these properties at design time, control is gained over the behavior of the data within the form, without having to close and reopen files. At run-time, these properties can provide useful information.

A cursor object also has three events (Init, Destroy, and Error). This allows encapsulation of code for each table. You might want to create one table if it does not exist when opened, but generate a dialog box for the user if unable to connect to a remote view in the same form or report.

The cursor object does not create a temporary table. If you modify data, the changes affect the table directly unless buffering is enabled. If buffering is enabled, changes are written to a buffer until they are applied to the source table or view.

REFERENCES

For more information on the cursor object, please see the Visual FoxPro Help file.

Modification Type:MajorLast Reviewed:11/17/2003
Keywords:kbDesigner kbinfo KB130298