执行一般的SQL语句时,我用connection对象; 如果一个Recordset对象需要保存不同的SQL语句查询结果时,我用command: dim rsResult as new adodb.recordset dim cmdQuery as new adodb.command ... cmdQuery="select * from table1" ...rsResult.open cmdQuery,cnn,.... 'rsResult是查询结果 ......cmdQuery="select f1,f2,f3 from table2 where ******" rsresult.requery 'rsResult中是新的SQL的查询结果。
而Connection 对象的 Execute 方法是静态的?
如果一个Recordset对象需要保存不同的SQL语句查询结果时,我用command:
dim rsResult as new adodb.recordset
dim cmdQuery as new adodb.command
...
cmdQuery="select * from table1"
...rsResult.open cmdQuery,cnn,....
'rsResult是查询结果
......cmdQuery="select f1,f2,f3 from table2 where ******"
rsresult.requery
'rsResult中是新的SQL的查询结果。