⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form_openinfo_grid.frm

📁 2008年版
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form form_Openinfo_grid 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   6360
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9015
   LinkTopic       =   "Form2"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "form_Openinfo_grid.frx":0000
   ScaleHeight     =   6360
   ScaleWidth      =   9015
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text1 
      Height          =   315
      Left            =   2220
      MaxLength       =   9
      TabIndex        =   9
      Top             =   720
      Width           =   1335
   End
   Begin VB.TextBox Text4 
      Height          =   315
      Left            =   2220
      TabIndex        =   8
      Top             =   1170
      Width           =   3405
   End
   Begin VB.TextBox Text2 
      Height          =   315
      Left            =   3660
      MaxLength       =   4
      TabIndex        =   6
      Top             =   720
      Width           =   855
   End
   Begin VB.TextBox Text3 
      Height          =   315
      Left            =   4620
      MaxLength       =   3
      TabIndex        =   5
      Top             =   720
      Width           =   1005
   End
   Begin VB.CommandButton Command3 
      Default         =   -1  'True
      Height          =   315
      Left            =   1500
      Picture         =   "form_Openinfo_grid.frx":2209F
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   5940
      Width           =   1095
   End
   Begin VB.CommandButton Command4 
      Height          =   315
      Left            =   3060
      Picture         =   "form_Openinfo_grid.frx":2217E
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   5940
      Width           =   1065
   End
   Begin VB.CommandButton Command5 
      Height          =   315
      Left            =   4590
      Picture         =   "form_Openinfo_grid.frx":2225D
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   5940
      Width           =   1035
   End
   Begin VB.CommandButton Command11 
      Cancel          =   -1  'True
      Height          =   315
      Left            =   6030
      Picture         =   "form_Openinfo_grid.frx":22342
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   5940
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Height          =   315
      Left            =   6360
      Picture         =   "form_Openinfo_grid.frx":2241F
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   1200
      Width           =   1005
   End
   Begin MSComctlLib.ListView ListView1 
      Height          =   4125
      Left            =   120
      TabIndex        =   7
      Top             =   1710
      Width           =   8775
      _ExtentX        =   15478
      _ExtentY        =   7276
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   12640511
      BorderStyle     =   1
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   0
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "公开信息列表"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   18
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   345
      Left            =   3570
      TabIndex        =   14
      Top             =   120
      Width           =   2235
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "索取号:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   690
      TabIndex        =   13
      Top             =   780
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "Label1"
      Height          =   15
      Left            =   5100
      TabIndex        =   12
      Top             =   2400
      Width           =   1215
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "信息名称:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   690
      TabIndex        =   11
      Top             =   1260
      Width           =   1215
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Height          =   255
      Left            =   5790
      TabIndex        =   10
      Top             =   750
      Width           =   3015
   End
End
Attribute VB_Name = "form_Openinfo_grid"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strCondition As String

Private Sub Command1_Click()
On Error GoTo e:
    strCondition = ""
    If Text1.text <> "" Then
        strCondition = strCondition + " and str_catchNum_K like '" & Text1.text + "-" & "%' "
    End If
    If Text2.text <> "" Then
        strCondition = strCondition + " and str_catchNum_K like '%" & "-" + Text2.text + "-" & "%' "
    End If
    If Text3.text <> "" Then
        strCondition = strCondition + " and str_catchNum_K like '%" & "-" + Text3.text & "' "
    End If
    If Text4.text <> "" Then
        strCondition = strCondition + " and str_fileTopic like '%" & Text4.text & "%'"
    End If
    Call Form_Load
Exit Sub
e:
strCondition = ""
Me.MousePointer = 0
End Sub

Private Sub Command11_Click()
    Unload Me
End Sub

Private Sub Command3_Click()
    flag = "Insert"
    form_Openinfo.Show 1
End Sub

Private Sub Command4_Click()
    If ListView1.ListItems.Count = 0 Then MsgBox "无记录!", 64, "": Exit Sub
    flag = "Modify"
    form_Openinfo.Show 1
End Sub

Private Sub Command5_Click()
    If ListView1.ListItems.Count = 0 Then MsgBox "无记录!", 64, "": Exit Sub
    Dim strCatch As String
    strCatch = ListView1.SelectedItem.text
    If (MsgBox("确实要删除" + strCatch + "吗?", vbYesNo + vbQuestion, "") = vbYes) Then
        strSql = "delete from t_openinfo_record where str_catchNum_K='" & strCatch & "'"
        conn.Execute (strSql)
        ListView1.ListItems.Remove (ListView1.SelectedItem.Index)
        MsgBox "删除成功!", 64, ""
    End If
    Call Form_Load
End Sub

Private Sub Form_Activate()
Call Form_Load
End Sub

Private Sub Form_Load()
'On Error Resume Next
    Dim itmX As ListItem
    Dim i As Integer
    Me.MousePointer = 11
    With ListView1
        .ColumnHeaders.Clear
        .ColumnHeaders.Add , , "索取号", 2200
        .ColumnHeaders.Add , , "信息名称", 3000
        .ColumnHeaders.Add , , "文件编号", 2000
        .ColumnHeaders.Add , , "产生日期", 1250
        .ColumnHeaders.Add , , "发布机构", 1400
        .ColumnHeaders.Add , , "公开类别", 1200
        .ColumnHeaders.Add , , "内容描述", 3400
        .ColumnHeaders.Add , , "存储位置", 3000
        .View = lvwReport
    End With
    strSql = "select str_catchNum_K,str_fileTopic   ,str_fileNum     ,dt_generateDate ,str_releaseOrg  ,str_category    ,str_description ,str_contentURL" + _
                    " from t_openinfo_record " + _
                    " where 1=1" + strCondition + _
                    " order by str_catchNum_K"
    rs.Open strSql, conn
    ListView1.ListItems.Clear
    While Not rs.EOF
        Set itmX = ListView1.ListItems.Add(, , xml("str_catchNum_K"))
        For i = 1 To 7
            If (Not IsNull(rs.Fields(i).Value)) Then
                itmX.SubItems(i) = CStr(rs.Fields(i).Value)
                If i = 5 Then itmX.SubItems(i) = cobb1(CStr(rs.Fields(i).Value))
            End If
        Next i
    rs.MoveNext
    'DoEvents
    Wend
    rs.Close
    Label7.Caption = "共" + CStr(ListView1.ListItems.Count) + "条记录"
    Me.MousePointer = 0
End Sub

Private Sub listview1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
On Error Resume Next
    Dim i As Integer
    With ListView1
        For i = 1 To .ColumnHeaders.Count
            If i = ColumnHeader.Index Then
                .SortKey = i - 1            ''对指定的列进行排列
                .Sorted = True
                        If .SortOrder = lvwDescending Then
                            .SortOrder = lvwAscending
                        Else
                            .SortOrder = lvwDescending
                        End If
                .Refresh
            End If
        Next
    End With
End Sub

Private Sub ListView1_DblClick()
If ListView1.ListItems.Count = 0 Then
    MsgBox "无记录!", 64, ""
    Exit Sub
End If
'Call Command4_Click
ShellExecute Me.hWnd, "open", ListView1.SelectedItem.SubItems(7), vbNullString, vbNullString, SW_SHOW
End Sub

Function cobb1(str As String) As String
Select Case str
Case "A": cobb1 = "主动公开"
Case "B": cobb1 = "依申请公开"
Case Else: cobb1 = ""
End Select
End Function

Function cobb2(str As String) As String
Select Case str
Case "A": cobb2 = "纸质"
Case "B": cobb2 = "胶卷"
Case "C": cobb2 = "磁带"
Case "D": cobb2 = "磁盘"
Case "E": cobb2 = "光盘"
Case "F": cobb2 = "其他"
Case Else: cobb2 = ""
End Select
End Function

Function cobb3(str As String) As String
Select Case str
Case "A": cobb3 = "文本"
Case "B": cobb3 = "图表"
Case "C": cobb3 = "照片"
Case "D": cobb3 = "影音"
Case "E": cobb3 = "其它"
Case Else: cobb3 = ""
End Select
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -