Source Property (Recordset) ADO

Indicates the source for the data in a Recordset object (Command object, SQL statement, table name, or stored procedure).

Applies To

Recordset

Settings and Return Values

Sets a String value or Command object reference; returns only a String value.

Remarks

Use the Source property to specify a data source for a Recordset object using one of the following: a Command object variable, an SQL statement, a stored procedure, or a table name. The Source property is read/write for closed Recordset objects and read-only for open Recordset objects.

If you set the Source property to a Command object, the ActiveConnection property of the Recordset object will inherit the value of the ActiveConnection property for the specified Command object. However, reading the Source property does not return a Command object; instead, it returns the CommandText property of the Command object to which you set the Source property.

If the Source property is an SQL statement, a stored procedure, or a table name, you can optimize performance by passing the appropriate Options argument with the Open method call.

Examples

Source Property Example (VB)


© 1997 Microsoft Corporation. All rights reserved.