新手求教 function函数,不会在所有代码路径上都返回值问题
 Private Function searchRowCount()

        Dim sSQL As String

        sSQL = ""
        If SpreadSheet1.Visible = True Then
            If gsConfig.POP_PLANT = "S01" Then
                sSQL = sSQL & "SELECT * FROM LEADASSY_JIANCHA_MONITER" & vbCrLf
            Else
                sSQL = sSQL & "SELECT * FROM LEADASSY_JIANCHA_REMAIN_D2" & vbCrLf
            End If


        End If


        Dim ds As DataSet = oraDB.oraSelect(sSQL)

        If ds.Tables(0).Rows.Count <> 0 Then
            Dim i As Integer = iRowCount \ 10

            Dim j As Integer = iRowCount Mod 10

            If j > 0 Then
                i = i + 1
            End If

            Return i
        End If

    End Function

1个回答

End Function前面加上
Return 0

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问