📄 seldatabas.bas
字号:
Attribute VB_Name = "SelDataBas"
Option Explicit
Public meObj As New SelRptGroup.SelRptGroupCls
Public Query As String
Public Const TitleStr = "报表组"
'//
Public Function getClassSql(ByVal inParentID As Long) As String
Dim RetValue As String
RetValue = "select a.Js_GroupID as FItemID,a.Js_GroupName as FName from Js_RptGroup a where a.Js_ParentID=" & inParentID & " and a.Js_Detail=0"
getClassSql = RetValue
End Function
Public Function getListSql(ByVal inParentID As Long) As String
Dim RetValue As String
Dim FParentIDs As String
FParentIDs = GetNextParID(inParentID)
If Trim(FParentIDs) <> "" Then
FParentIDs = "(" & inParentID & "," & Right(FParentIDs, Len(FParentIDs) - 1) & ")"
Else
FParentIDs = "(" & inParentID & ")"
End If
RetValue = "select a.Js_GroupID as FItemID,a.Js_GroupName as FName,b.Js_GroupName as FPName,"
RetValue = RetValue & " FDateil=case a.Js_Detail when 0 then '报表目录' when 1 then '报表组' end,"
RetValue = RetValue & " FUseSign=case a.Js_UseSign when 0 then '禁止' when 1 then '启用' end"
RetValue = RetValue & " from Js_RptGroup a"
RetValue = RetValue & " left join Js_RptGroup b on b.Js_GroupID=a.Js_ParentID"
RetValue = RetValue & " where a.Js_Detail=1 and a.Js_ParentID in " & FParentIDs
getListSql = RetValue
End Function
Public Function GetNextParID(ByVal inParentID As Long) As String
Dim RetStrValue As String
Dim RetIntValue As Long
Dim daCn As New ADODB.Connection
Dim daRs As New ADODB.Recordset
Dim Sql As String
'//
Sql = "select Js_GroupID from Js_RptGroup where Js_ParentID=" & inParentID & " and Js_Detail=0"
daCn.ConnectionString = meObj.BaseInfo.getConStr
daCn.Open
daRs.CursorLocation = adUseClient
daRs.Open Sql, daCn, adOpenStatic, adLockReadOnly
If Not daRs.EOF Then
While Not daRs.EOF
If Not IsNull(daRs(0)) Then
RetIntValue = daRs(0)
RetStrValue = RetStrValue & "," & RetIntValue
RetStrValue = RetStrValue & GetNextParID(RetIntValue)
End If
daRs.MoveNext
Wend
End If
daRs.Close
daCn.Close
Set daRs = Nothing
Set daCn = Nothing
GetNextParID = RetStrValue
End Function
Public Function getListTitle() As String
Dim RetValue As String
RetValue = "组内码|组名称|目录名称|组类型|组状态|"
getListTitle = RetValue
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -