|Visual FoxPro 9.0 SP2|
|DataSource Property (Visual FoxPro)|
Specifies the data source for DataEnvironment and CursorAdapter objects to use. The DataEnvironment or CursorAdapter DataSourceType property determines the value of the corresponding DataSource property. Read/write at design time and run time. There are two versions of the syntax.
DataEnvironment.DataSource [= DataSource]
CursorAdapter.DataSource [= DataSource]
Specifies a reference to an existing data source of permissible data source types. DataSource acts only as a pointer to the actual data source, which must exist at run time.
The following table lists the values for DataSource, which depend on the value of the DataSourceType property.
Reference to a valid ActiveX Data Object (ADO) RecordSet object
Positive integer that represents or memory variable that contains a valid Open Database Connectivity (ODBC) connection handle
"Native", "XML", null (.NULL.), or empty string ("")
When the CursorAdapter DataSourceType is "Native", specifying CursorAdapter DataSource is not required because the cursor returned by the CursorAdapter SelectCmd property is the default data source. The name of the cursor returned is determined by the CursorAdapter Alias property, which is set by the CursorAdapter CursorFill method.
If the CursorAdapter InsertCmdDataSourceType, UpdateCmdDataSourceType, and DeleteCmdDataSourceType properties are empty, the CursorAdapter DataSource property overrides the CursorAdapter InsertCmdDataSource, UpdateCmdDataSource, and DeleteCmdDataSource properties.
If the CursorAdapter UseDeDataSource property is True (.T.), the DataEnvironment DataSource and DataSourceType properties override the same CursorAdapter properties.
Comment or report problem with topic