写一个公共函数:
''' <summary>
''' 獲取報表路徑
''' </summary>
''' <param name="strMode">模組名稱</param>
''' <param name="strRPTName">報表名稱</param>
''' <returns></returns>
''' <remarks></remarks>
Public Function GetReportPath(ByVal strMode As String, ByVal strRPTName As String) As String
Try
Dim sql, reportPath As String
sql = "select Top 1 isnull(ListA,'')+'" + strRPTName + "' from dbo.BSC_OtherDefineB "
sql += "where ListCode='" + strMode + "' and ItemNo=(select Top 1 ID from dbo.BSC_OtherDefineA where ItemCode='ReportPath') "
reportPath = GetValue(sql)
Return reportPath
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, Msg.CompanyName)
End Try
End Function