📄 frmmkbjcx.frm
字号:
Visible = 0 'False
Width = 1680
_ExtentX = 2963
_ExtentY = 1217
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSComCtl2.DTPicker DTPicker2
BeginProperty DataFormat
Type = 1
Format = "yyyy-MM-dd"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 3
EndProperty
Height = 300
Left = 7200
TabIndex = 5
Top = 750
Width = 1290
_ExtentX = 2275
_ExtentY = 529
_Version = 393216
Format = 23724033
CurrentDate = 37696
End
Begin MSComCtl2.DTPicker DTPicker1
BeginProperty DataFormat
Type = 1
Format = "yyyy-MM-dd"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 3
EndProperty
Height = 300
Left = 7185
TabIndex = 6
Top = 345
Width = 1290
_ExtentX = 2275
_ExtentY = 529
_Version = 393216
Format = 23724033
CurrentDate = 37696
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "请输入要查询的路灯号:"
BeginProperty Font
Name = "新宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 180
Left = 6480
TabIndex = 13
Top = 1200
Width = 1980
End
Begin VB.Label Label1
Caption = "日 期:"
Height = 285
Index = 0
Left = 6540
TabIndex = 11
Top = 375
Width = 990
End
Begin VB.Label Label5
Caption = "至"
Height = 285
Left = 6840
TabIndex = 10
Top = 750
Width = 270
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "总记录数:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 4560
TabIndex = 9
Top = 540
Width = 945
End
Begin VB.Label LabZJL
Caption = "0"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 5580
TabIndex = 8
Top = 540
Width = 750
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "门 开 报 警 查 询"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
Index = 1
Left = 1530
TabIndex = 7
Top = 120
Width = 3225
End
End
Attribute VB_Name = "FrmMKBJCX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim lAdoRs As New ADODB.Recordset
Dim sql As String
Private Sub CmdSetup_Click() '打印设置
On Error Resume Next
CommonDialog1.Flags = cdlPDPrintSetup
CommonDialog1.CancelError = True
CommonDialog1.ShowPrinter
End Sub
Private Sub Commclose_Click()
On Error Resume Next
Unload Me
End Sub
Private Sub Commmquery_Click() '查询门开报警记录
On Error Resume Next
sql = ""
sql = "select 路灯参数.路灯号,路灯参数.公里号,门开报警.门开状态, 门开报警.值班员, 门开报警.日期, 门开报警.时间,门开报警.类型, 门开报警.日期CX from 路灯参数,门开报警 where 门开报警.路灯号=路灯参数.路灯号 and 门开报警.日期 Between #" + Format(DTPicker1.Value, "yyyy-mm-dd") + "# and #" + Format(DTPicker2.Value, "yyyy-mm-dd") + "# "
If Trim(TextLDH.Text) <> "" Then
sql = sql + "and 门开报警.路灯号='" + Trim(TextLDH.Text) + "'"
End If
sql = sql & "order by 日期CX DESC"
Adodc1.RecordSource = Trim(sql)
Adodc1.Refresh
LabZJL.Caption = Adodc1.Recordset.RecordCount
End Sub
Private Sub CommPrint_click()
On Error Resume Next
If sql = "" Then '没有被查询的记录则退出
Exit Sub
End If
Me.Refresh
On Error Resume Next
Set lAdoRs = New ADODB.Recordset
lAdoRs.CursorLocation = adUseClient
lAdoRs.Open Adodc1.RecordSource, adocnsting, adOpenDynamic, adLockOptimistic, adCmdText
Set ReportMKCX.DataSource = rst
ReportMKCX.Sections(1).Controls(1).Caption = Format(DTPicker1.Value, "yyyy年mm月dd日") & "至" & Format(DTPicker2.Value, "yyyy年mm月dd日")
ReportMKCX.Sections(1).Controls(3).Caption = gUserName
ReportMKCX.Sections(1).Controls(6).Caption = Trim(LabZJL.Caption)
ReportMKCX.Show vbModal
rst.Close
ErrorHandle:
End Sub
Private Sub Form_Load()
On Error Resume Next
DTPicker1.Value = Now
DTPicker2.Value = Now
Set lAdoRs = New ADODB.Recordset
lAdoRs.CursorLocation = adUseClient
Adodc1.ConnectionString = adocnstring
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -