📄 form36.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form36
BorderStyle = 0 'None
Caption = "Form36"
ClientHeight = 7905
ClientLeft = 0
ClientTop = 0
ClientWidth = 12165
LinkTopic = "Form36"
Picture = "Form36.frx":0000
ScaleHeight = 8010
ScaleMode = 0 'User
ScaleWidth = 12165
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox Combo2
Appearance = 0 'Flat
Height = 300
Left = 4080
TabIndex = 4
Text = "Like"
Top = 240
Width = 1935
End
Begin VB.CommandButton Command2
Appearance = 0 'Flat
Caption = "取消"
Height = 300
Left = 11040
Picture = "Form36.frx":2C55
Style = 1 'Graphical
TabIndex = 3
Top = 240
Width = 735
End
Begin VB.CommandButton Command1
Appearance = 0 'Flat
Caption = "查询"
Height = 300
Left = 9720
Picture = "Form36.frx":3DF9
Style = 1 'Graphical
TabIndex = 2
Top = 240
Width = 735
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 300
Left = 6960
TabIndex = 1
Top = 240
Width = 2055
End
Begin VB.ComboBox Combo1
Appearance = 0 'Flat
Height = 300
Left = 960
TabIndex = 0
Top = 240
Width = 2175
End
Begin VB.Timer Timer1
Interval = 64768
Left = 6480
Top = 6360
End
Begin MSComctlLib.ListView ListView1
Height = 6615
Left = 0
TabIndex = 5
Top = 840
Width = 12135
_ExtentX = 21405
_ExtentY = 11668
View = 3
LabelWrap = -1 'True
HideSelection = -1 'True
Checkboxes = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
HotTracking = -1 'True
_Version = 393217
ForeColor = 0
BackColor = 16777215
BorderStyle = 1
Appearance = 0
NumItems = 5
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = " 单位名称"
Object.Width = 5292
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 1
Text = "工程编号"
Object.Width = 5292
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 2
Text = "时间"
Object.Width = 3175
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 3
Text = "共计"
Object.Width = 2999
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 4
Text = "作业组"
Object.Width = 4189
EndProperty
Picture = "Form36.frx":4F9D
End
Begin VB.Label Label5
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 375
Left = 0
TabIndex = 9
Top = 7560
Width = 11175
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "内容:"
ForeColor = &H00FF0000&
Height = 375
Left = 6360
TabIndex = 8
Top = 360
Width = 975
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "条件:"
ForeColor = &H00FF0000&
Height = 375
Left = 3480
TabIndex = 7
Top = 360
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "项目:"
ForeColor = &H00FF0000&
Height = 255
Left = 360
TabIndex = 6
Top = 360
Width = 855
End
End
Attribute VB_Name = "Form36"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim i, j, r As Integer
Dim sqlstring As String
Static l As Integer
If Combo1 = "" Or Combo2 = "" Or Text1 = "" Then
MsgBox "‘表达式不正确’", vbInformation, "提示框!"
Exit Sub
End If
Form36.ListView1.ListItems.Clear
sqlstring = "SELECT * FROM " & biaoming & " WHERE " & Combo1 & " " & Combo2 & " '%" & Text1 & "%'"
grs.Open sqlstring, gconn
l = 0
For i = 1 To grs.RecordCount
l = l + 1
Form36.ListView1.ListItems.Add i, , grs.Fields(0).Value
Form36.ListView1.ListItems.Item(i).SubItems(1) = grs.Fields(1).Value
Form36.ListView1.ListItems.Item(i).SubItems(2) = grs.Fields(2).Value
Form36.ListView1.ListItems.Item(i).SubItems(3) = grs.Fields(52).Value
Form36.ListView1.ListItems.Item(i).SubItems(4) = grs.Fields(53).Value
If grs.Fields(122).Value = "0" And grs.Fields(124).Value = "0" Then
Form36.ListView1.ListItems.Item(i).ForeColor = vbRed
For m = 1 To 4
Form36.ListView1.ListItems.Item(i).ListSubItems(m).ForeColor = vbRed
Next
End If
grs.MoveNext
Next
grs.Close
If l <> 0 Then
Form36.Label5.Caption = " 共有" & l & "记录满足查询条件"
Else
Form36.ListView1.ListItems.Clear
grs.CursorLocation = adUseClient
grs.Open "select * from " & biaoming & " order by 工程编号", gconn, adOpenKeyset, adLockPessimistic
For i = 1 To grs.RecordCount
l = l + 1
Form36.ListView1.ListItems.Add i, , grs.Fields(0).Value
Form36.ListView1.ListItems.Item(i).SubItems(1) = grs.Fields(1).Value
Form36.ListView1.ListItems.Item(i).SubItems(2) = grs.Fields(2).Value
Form36.ListView1.ListItems.Item(i).SubItems(3) = grs.Fields(52).Value
Form36.ListView1.ListItems.Item(i).SubItems(4) = grs.Fields(53).Value
If grs.Fields(122).Value = "0" And grs.Fields(124).Value = "0" Then
Form36.ListView1.ListItems.Item(i).ForeColor = vbRed
For m = 1 To 4
Form36.ListView1.ListItems.Item(i).ListSubItems(m).ForeColor = vbRed
Next
End If
grs.MoveNext
Next
grs.Close
MsgBox "没有查询的内容", vbInformation, "提示框!"
End If
For r = 1 To Form36.ListView1.ListItems.Count
Form36.ListView1.ListItems.Item(r).Checked = False
Next
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim i, j, l, m As Integer
With Me
.Height = 8010
.left = 2332
.top = 2600
.Width = 12160
End With
With Combo2
.AddItem ("Like")
End With
Form36.ListView1.ListItems.Clear
grs.CursorLocation = adUseClient
grs.Open "select * from " & biaoming & " order by 工程编号", gconn, adOpenKeyset, adLockPessimistic
For j = 0 To 2
Form36.Combo1.AddItem (grs.Fields(j).Name)
Next j
For i = 1 To grs.RecordCount
k = k + 1
Form36.ListView1.ListItems.Add , , grs.Fields(0).Value
Form36.ListView1.ListItems.Item(i).SubItems(1) = grs.Fields(1).Value
Form36.ListView1.ListItems.Item(i).SubItems(2) = grs.Fields(2).Value
Form36.ListView1.ListItems.Item(i).SubItems(3) = grs.Fields(52).Value
Form36.ListView1.ListItems.Item(i).SubItems(4) = grs.Fields(53).Value
If grs.Fields(122).Value = "0" And grs.Fields(124).Value = "0" Then
Form36.ListView1.ListItems.Item(k).ForeColor = vbRed
For m = 1 To 4
Form36.ListView1.ListItems.Item(k).ListSubItems.Item(m).ForeColor = vbRed
Next
End If
grs.MoveNext
Next
grs.Close
If Form36.ListView1.ListItems.Count <> "0" Then
Form36.ListView1.ListItems(Form36.ListView1.ListItems.Count).Selected = True
Form36.ListView1.SelectedItem.EnsureVisible
Form36.ListView1.Refresh
End If
End Sub
Private Sub ListView1_DblClick()
Dim i, a, b, j, n, m, r As Integer
Dim p1, p2, p3 As Single
Static l As Integer
Dim a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a40, a41, a42, a43, a44, a45, a46, a47, a48, a49, a50, a51, a52, a53, a54, a55, a56, a57, a58, a59, a60, a61, a62, a63, a64, a65, a66, a67, a68, a69, a70, a81, a82, a83, a84, a85, a86, a87, a88, a89, a90, a91, a92, a93, a94, a95, a96, a97, a98, a99, a100, a101, a102, a103, a104, a105, a106, a107, a108, a109, a110, a121, a122, a123, a124, a125, a126, a127, a128, a129, a130, a131 As String
a = 0
b = 0
j = 0
For i = 1 To Form36.ListView1.ListItems.Count
If Form36.ListView1.ListItems.Item(i).Checked = True Then
m = m + 1
End If
Next
If m <> 1 Then
MsgBox "选择一条记录!", vbInformation, "提示"
Exit Sub
End If
For n = 1 To Form36.ListView1.ListItems.Count
If Form36.ListView1.ListItems.Item(n).Checked = True Then
For Each mytab In gcat.Tables
a = a + 1
lty11 = mytab.Name
lty12 = left(lty11, 2)
If lty12 <> "sy" And lty12 <> "dt" And lty12 <> "my" And lty12 <> "密码" And lty12 <> "流程" Then
grs.CursorLocation = adUseClient
grs.Open lty11, gconn, adOpenKeyset, adLockPessimistic
For j = 1 To grs.RecordCount
If grs.Fields(1).Value = Form36.ListView1.ListItems.Item(n).ListSubItems(1) Then
If grs.Fields(0) = 0 Then
a1 = ""
Else
a1 = grs.Fields(0)
End If
If grs.Fields(1) = 0 Then
a2 = ""
Else
a2 = grs.Fields(1)
End If
If grs.Fields(2) = 0 Then
a3 = ""
Else
a3 = grs.Fields(2)
End If
If grs.Fields(3) = 0 Then
a4 = ""
Else
a4 = grs.Fields(3)
End If
If grs.Fields(4) = 0 Then
a5 = ""
Else
a5 = grs.Fields(4)
End If
If grs.Fields(5) = 0 Then
a6 = ""
Else
a6 = grs.Fields(5)
End If
If grs.Fields(6) = 0 Then
a7 = ""
Else
a7 = grs.Fields(6)
End If
If grs.Fields(7) = 0 Then
a8 = ""
Else
a8 = grs.Fields(7)
End If
If grs.Fields(8) = 0 Then
a9 = ""
Else
a9 = grs.Fields(8)
End If
If grs.Fields(9) = 0 Then
a10 = ""
Else
a10 = grs.Fields(9)
End If
If grs.Fields(10) = 0 Then
a11 = ""
Else
a11 = grs.Fields(10)
End If
If grs.Fields(11) = 0 Then
a12 = ""
Else
a12 = grs.Fields(11)
End If
If grs.Fields(12) = 0 Then
a13 = ""
Else
a13 = grs.Fields(12)
End If
If grs.Fields(13) = 0 Then
a14 = ""
Else
a14 = grs.Fields(13)
End If
If grs.Fields(14) = 0 Then
a15 = ""
Else
a15 = grs.Fields(14)
End If
If grs.Fields(15) = 0 Then
a16 = ""
Else
a16 = grs.Fields(15)
End If
If grs.Fields(16) = 0 Then
a17 = ""
Else
a17 = grs.Fields(16)
End If
If grs.Fields(17) = 0 Then
a18 = ""
Else
a18 = grs.Fields(17)
End If
If grs.Fields(18) = 0 Then
a19 = ""
Else
a19 = grs.Fields(18)
End If
If grs.Fields(19) = 0 Then
a20 = ""
Else
a20 = grs.Fields(19)
End If
If grs.Fields(20) = 0 Then
a21 = ""
Else
a21 = grs.Fields(20)
End If
If grs.Fields(21) = 0 Then
a22 = ""
Else
a22 = grs.Fields(21)
End If
If grs.Fields(22) = 0 Then
a23 = ""
Else
a23 = grs.Fields(22)
End If
If grs.Fields(23) = 0 Then
a24 = ""
Else
a24 = grs.Fields(23)
End If
If grs.Fields(24) = 0 Then
a25 = ""
Else
a25 = grs.Fields(24)
End If
If grs.Fields(25) = 0 Then
a26 = ""
Else
a26 = grs.Fields(25)
End If
If grs.Fields(26) = 0 Then
a27 = ""
Else
a27 = grs.Fields(26)
End If
If grs.Fields(27) = 0 Then
a28 = ""
Else
a28 = grs.Fields(27)
End If
If grs.Fields(28) = 0 Then
a29 = ""
Else
a29 = grs.Fields(28)
End If
If grs.Fields(29) = 0 Then
a30 = ""
Else
a30 = grs.Fields(29)
End If
If grs.Fields(30) = 0 Then
a31 = ""
Else
a31 = grs.Fields(30)
End If
If grs.Fields(31) = 0 Then
a32 = ""
Else
a32 = grs.Fields(31)
End If
If grs.Fields(32) = 0 Then
a33 = ""
Else
a33 = grs.Fields(32)
End If
If grs.Fields(33) = 0 Then
a34 = ""
Else
a34 = grs.Fields(33)
End If
If grs.Fields(34) = 0 Then
a35 = ""
Else
a35 = grs.Fields(34)
End If
If grs.Fields(35) = 0 Then
a36 = ""
Else
a36 = grs.Fields(35)
End If
If grs.Fields(36) = 0 Then
a37 = ""
Else
a37 = grs.Fields(36)
End If
If grs.Fields(37) = 0 Then
a38 = ""
Else
a38 = grs.Fields(37)
End If
If grs.Fields(38) = 0 Then
a39 = ""
Else
a39 = grs.Fields(38)
End If
If grs.Fields(39) = 0 Then
a40 = ""
Else
a40 = grs.Fields(39)
End If
If grs.Fields(40) = 0 Then
a41 = ""
Else
a41 = grs.Fields(40)
End If
If grs.Fields(41) = 0 Then
a42 = ""
Else
a42 = grs.Fields(41)
End If
If grs.Fields(42) = 0 Then
a43 = ""
Else
a43 = grs.Fields(42)
End If
If grs.Fields(43) = 0 Then
a44 = ""
Else
a44 = grs.Fields(43)
End If
If grs.Fields(44) = 0 Then
a45 = ""
Else
a45 = grs.Fields(44)
End If
If grs.Fields(45) = 0 Then
a46 = ""
Else
a46 = grs.Fields(45)
End If
If grs.Fields(46) = 0 Then
a47 = ""
Else
a47 = grs.Fields(46)
End If
If grs.Fields(47) = 0 Then
a48 = ""
Else
a48 = grs.Fields(47).Value
End If
If grs.Fields(48) = 0 Then
a49 = ""
Else
a49 = grs.Fields(48)
End If
If grs.Fields(49) = 0 Then
a50 = ""
Else
a50 = grs.Fields(49)
End If
If grs.Fields(50) = 0 Then
a51 = ""
Else
a51 = grs.Fields(50)
End If
If grs.Fields(51) = 0 Then
a52 = ""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -