我的主管让我在 vb6 中调试一个最近的程序。我只有vb的基础知识。当我尝试运行程序时,会显示 byref 参数不匹配。谁能帮我这个。我会很感激任何评论。
Public Sub S2_Sort()
'loop day
For dCnt = 1 To UBound(S2.Day())
ReDim S2.Day(dCnt).tList(0)
'loop shift
For tCnt = 1 To UBound(TaskID())
ReDim Preserve S2.Day(dCnt).tList(tCnt)
ReDim Preserve S2.Day(dCnt).tList(tCnt).sList(0)
'dicShift.RemoveAll
'loop task
For sCnt = 1 To UBound(Shift())
ReDim Preserve S2.Day(dCnt).tList(tCnt).sList(sCnt)
ReDim Preserve S2.Day(dCnt).tList(tCnt).sList(sCnt).TaskRecList(0)
'query with paramaters for project, datetime, and taskid
strQuery = "SELECT * FROM PROD_DB WHERE PROJECT_ID = '" & inpProject & "'" & _
" AND " & GetTimestamp(S2.Day(dCnt).DayVal, Shift(sCnt).NextDay, True, Shift(sCnt).StartHour, _
Shift(sCnt).HourLen) & _
" AND TASK_ID = '" & TaskID(tCnt).TaskID & "'" & _
" ORDER BY START_TIME, TASK_ID"
Set rstInfo = AdoConn.Execute(strQuery)
If Not (rstInfo.EOF And rstInfo.BOF) Then
rstInfo.MoveFirst
wCnt = 0
Do Until rstInfo.EOF
wCnt = wCnt + 1
ReDim Preserve S2.Day(dCnt).tList(tCnt).sList(sCnt).TaskRecList(wCnt)
'save the records to a arraylist datarecord
Call SetDataRecord(rstInfo, wCnt)
'then compute, get the work time number and list it on stLIst
S2.Day(dCnt).tList(tCnt).sList(sCnt).Val = S2_Compute(S2.Day(dCnt).tList(tCnt).sList(sCnt).TaskRecList(wCnt), S2.Day(dCnt).tList(tCnt).sList(sCnt).Val)
S2.Day(dCnt).tList(tCnt).Val = S2_Compute(S2.Day(dCnt).tList(tCnt).sList(sCnt).TaskRecList(wCnt), S2.Day(dCnt).tList(tCnt).Val)
'S2.Day(dCnt).tList(tCnt).MstUnit = DataRecord(X).MeasurementUnit
'S2.Day(dCnt).tList(tCnt).Cost = DataRecord(X).Cost
S2.Day(dCnt).tList(tCnt).ResourceName = S2.Day(dCnt).tList(tCnt).ResourceName + S2.Day(dCnt).tList(tCnt).sList(sCnt).TaskRecList(wCnt).ResourceName
S2.Day(dCnt).Val = S2_Compute(S2.Day(dCnt).tList(tCnt).sList(sCnt).TaskRecList(wCnt), S2.Day(dCnt).Val)
rstInfo.MoveNext
Loop
End If
Set rstInfo = Nothing
Next sCnt 'Next Shift
Next tCnt 'Next Task
Next dCnt 'Next Day
End Sub