SQL SERVER2000+VB6
==========================================
Dim cd As ADODB.Command
Dim rs As ADODB.Recordset
Set cd = New ADODB.Command
cd.CommandText = "MyTest"
cd.CommandType = adCmdStoredProc
Set cd.ActiveConnection = g_Cnn
g_Cnn.Errors.Clear
Set rs = New ADODB.Recordset
With rs
.CursorLocation = adUseClient
.CursorType = adOpenForwardOnly
.LockType = adLockReadOnly
End With
Set rs = cd.Execute
===========================================
数据库中的存储过程MyTest中内容如下:
SEELCT * FR0M T1
SEELCT * FROM T2-----------------------------------------问题:运行这段代码,执行Set rs = cd.Execute后,rs为T1的查询纪录,怎样才能取出T2的查询结果呢?谢谢!
==========================================
Dim cd As ADODB.Command
Dim rs As ADODB.Recordset
Set cd = New ADODB.Command
cd.CommandText = "MyTest"
cd.CommandType = adCmdStoredProc
Set cd.ActiveConnection = g_Cnn
g_Cnn.Errors.Clear
Set rs = New ADODB.Recordset
With rs
.CursorLocation = adUseClient
.CursorType = adOpenForwardOnly
.LockType = adLockReadOnly
End With
Set rs = cd.Execute
===========================================
数据库中的存储过程MyTest中内容如下:
SEELCT * FR0M T1
SEELCT * FROM T2-----------------------------------------问题:运行这段代码,执行Set rs = cd.Execute后,rs为T1的查询纪录,怎样才能取出T2的查询结果呢?谢谢!
union all
select * from t2
先谢谢你不过我的意思是,如果确实有两个纪录集,在SQL查询分析器中也可看到是两个而不是你说的合并方式,在应用程序中如何取出?我的SEELCT * FR0M T1 和 SEELCT * FROM T2 只是为了说明问题。这是我在SQL版发的原贴:
http://topic.csdn.net/u/20080619/11/58dd4307-0d35-4787-9202-ff72062bae43.html
所以才有这样的提问,再次恳请左手及其他兄弟帮忙!
用rs.nextrecordset