做不到的。說說為什麼要這麼做,兩個記錄集中都什麼內容,大家可以想想辦法幫你把他門都寫到一個rs裡去。最笨的辦法,再做個rs Dim rst As New ADODB.Recordset With rst .Fields.Append "...",... .Fields.Append "...",... .Fields.Append "...",... .Fields.Append "...",... .LockType = adLockOptimistic .Open End With 然後把兩個rs的內容隔行寫進去
說說為什麼要這麼做,兩個記錄集中都什麼內容,大家可以想想辦法幫你把他門都寫到一個rs裡去。最笨的辦法,再做個rs Dim rst As New ADODB.Recordset With rst .Fields.Append "...",... .Fields.Append "...",... .Fields.Append "...",... .Fields.Append "...",... .LockType = adLockOptimistic .Open End With 然後把兩個rs的內容隔行寫進去 你的意思是说“然後把兩個rs的內容隔行寫進去”比如:rs1 select branch,SUM(corigamt02) AS ktyj,((sum(corigamt01)/sum(origamt) )*100) as bfb from zemepf where batcactmn='3' group by branch order by branchRS2:select sum(corigamt01) from zemepf group by branch order by branch怎么加到DATAGRID1里?
Dim rst As New ADODB.Recordset
With rst
.Fields.Append "...",...
.Fields.Append "...",...
.Fields.Append "...",...
.Fields.Append "...",...
.LockType = adLockOptimistic
.Open
End With
然後把兩個rs的內容隔行寫進去
Dim rst As New ADODB.Recordset
With rst
.Fields.Append "...",...
.Fields.Append "...",...
.Fields.Append "...",...
.Fields.Append "...",...
.LockType = adLockOptimistic
.Open
End With
然後把兩個rs的內容隔行寫進去
你的意思是说“然後把兩個rs的內容隔行寫進去”比如:rs1
select branch,SUM(corigamt02) AS ktyj,((sum(corigamt01)/sum(origamt) )*100) as bfb
from
zemepf where batcactmn='3' group by branch order by branchRS2:select sum(corigamt01) from zemepf group by branch order by branch怎么加到DATAGRID1里?
10 1000 5 3000
20 2000 5 2000
30 1500 5 5000
rst1,rst2循環往rst裡寫就是了。不過應該沒必要,把你的表結構貼出來。
下班了,明天在說,byebye:D