其实TADOQuery,TADOTable都是从TADODataSet继承下来的。TADODataSet使用起来更具有一般性。通过设置TADODataSet的CommandType为以下值: cmdUnknown The type of command in the CommandText property is not known. cmdText CommandText is a textual definition of a command or stored procedure call; data returned by an internal SQL statement. cmdTable CommandText is the name of a table. cmdStoredProc CommandText is the name of a stored procedure. cmdFile CommandText is the name of a saved recordset file. cmdTableDirect CommandText is the name of a table; all columns are returned.再设置CommandText为CommandType所对应的参数,即可以模拟TADOQuery和TADOTable。
记得李维的<<delphi7数据库高效设计>>里面有这两个控件对比
cmdUnknown The type of command in the CommandText property is not known.
cmdText CommandText is a textual definition of a command or stored procedure call; data returned by an internal SQL statement.
cmdTable CommandText is the name of a table.
cmdStoredProc CommandText is the name of a stored procedure.
cmdFile CommandText is the name of a saved recordset file.
cmdTableDirect CommandText is the name of a table; all columns are returned.再设置CommandText为CommandType所对应的参数,即可以模拟TADOQuery和TADOTable。