源属性 (ADO 记录集)
指示 Recordset 对象的数据源。
设置和返回值
设置 字符串 值或 命令 对象引用;仅返回一个 字符串 值,该值指示 Recordset的源。
言论
使用 Source 属性,使用以下项之一为 Recordset 对象指定数据源:Command 对象变量、SQL 语句、存储过程或表名。
如果将 Source 属性设置为 Command 对象,则 Recordset 对象的 ActiveConnection 属性将继承指定 Command 对象的 ActiveConnection 属性的值。 但是,读取 Source 属性不会返回 Command 对象;而是返回 Command 对象的 CommandText 属性,Source 属性。
如果 Source 属性是 SQL 语句、存储过程或表名称,则可以使用 Open 方法调用传递相应的 Options 参数来优化性能。
Source 属性是 Recordset 对象的读/写,对于打开的 Recordset 对象,该属性为只读。