# vb6好慢...如何加快?t.k.s.

Posted by daniel on October 31, 1999 at 20:15:00:

Set rs2 = db.OpenRecordset("人事资料表", dbOpenDynaset)
If rs2.RecordCount <> 0 Then
rs2.MoveFirst
while not rs2.eof
sql = "select * from 员工请假表 where 工号='" & rs2![工号] & "'" & " and " & "year(请假日期)-1911=" & Val(Left$(mstryymm, 2)) & " and " & "month(请假日期)=" & Val(Right$(mstryymm, 2))
Set rs3 = db.OpenRecordset(sql, dbOpenDynaset)
If rs3.RecordCount <> 0 Then
rs3.MoveFirst
While Not rs3.EOF
.
.
rs3.MoveNext
Wend
End If
'
sql = "select * from 员工加班表 where 工号='" & rs2![工号] & "'" & " and " & "year(请假日期)-1911=" & Val(Left$(mstryymm, 2)) & " and " & "month(加班日期)=" & Val(Right$(mstryymm, 2))
Set rs4 = db.OpenRecordset(sql, dbOpenDynaset)
If rs4.RecordCount <> 0 Then
rs4.MoveFirst
While Not rs4.EOF
.
.
rs4.MoveNext
Wend
End If
'
.
.
rs2.MoveNext
wend
endif

Follow Ups:

- Re: vb6好慢...如何加快?t.k.s. andyLin 22:28:41 10/31/99 (0)