代码简化
程序代码:
这段代码可以简化,使速度加快吗? xxx = rs.GetRows(-1, 1, Array("MRP_Cntrlr", "Req_Date", "Assy_Number", "Partcode", "Vendor_Name")) Set d0 = CreateObject("Scripting.Dictionary") Set d1 = CreateObject("Scripting.Dictionary") Set d2 = CreateObject("Scripting.Dictionary") Set d3 = CreateObject("Scripting.Dictionary") Set d4 = CreateObject("Scripting.Dictionary") For yy = 0 To UBound(xxx, 2) d0(xxx(0, yy)) = "" d1(xxx(1, yy)) = "" d2(xxx(2, yy)) = "" d3(xxx(3, yy)) = "" d4(xxx(4, yy)) = "" Next yy kk0 = d0.Keys kk1 = d1.Keys kk2 = d2.Keys kk3 = d3.Keys kk4 = d4.Keys For i = 0 To 4 Combo1(i).Clear Combo1(i).AddItem "-All-" Next i For k0 = 0 To UBound(kk0) Combo1(0).AddItem kk0(k0) Next For k1 = 0 To UBound(kk1) Combo1(1).AddItem kk1(k1) Next For k2 = 0 To UBound(kk2) Combo1(2).AddItem kk2(k2) Next For k3 = 0 To UBound(kk3) Combo1(3).AddItem kk3(k3) Next For k4 = 0 To UBound(kk4) Combo1(4).AddItem IIf(IsNull(kk4(k4)), "", kk4(k4)) Next