📄 frmtdtzb.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmtdtzb
Caption = "用户停电通知统计表"
ClientHeight = 6165
ClientLeft = 60
ClientTop = 345
ClientWidth = 7860
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 6165
ScaleWidth = 7860
Begin VB.CommandButton Command4
Caption = "打印"
Height = 375
Left = 6600
TabIndex = 8
Top = 5160
Width = 975
End
Begin VB.CommandButton Command3
Caption = "查询"
Height = 375
Left = 5160
TabIndex = 7
Top = 5160
Width = 975
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 375
Left = 5640
TabIndex = 4
Top = 360
Width = 1455
_ExtentX = 2566
_ExtentY = 661
_Version = 393216
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
Format = 64749569
CurrentDate = 37893
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 2400
TabIndex = 3
Top = 360
Width = 1575
_ExtentX = 2778
_ExtentY = 661
_Version = 393216
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
Format = 64749569
CurrentDate = 37893
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 375
Index = 1
Left = 3600
TabIndex = 2
Top = 5160
Width = 975
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Index = 0
Left = 1920
TabIndex = 1
Top = 5160
Width = 975
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frmtdtzb.frx":0000
Height = 4095
Left = 120
TabIndex = 0
Top = 960
Width = 7455
_ExtentX = 13150
_ExtentY = 7223
_Version = 393216
AllowUpdate = -1 'True
BackColor = 16761024
ForeColor = 8388608
HeadLines = 1
RowHeight = 18
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 240
Top = 5640
Visible = 0 'False
Width = 6855
_ExtentX = 12091
_ExtentY = 661
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 = "PROVIDER=MSDASQL;dsn=ddmis;uid=mis;pwd=mis005;database=zhcx"
OLEDBString = "PROVIDER=MSDASQL;dsn=ddmis;uid=mis;pwd=mis005;database=zhcx"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from xdgl_yhtzb"
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 VB.Label Label2
Caption = "结束时间"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 4320
TabIndex = 6
Top = 480
Width = 1215
End
Begin VB.Label Label1
Caption = "开始时间 "
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 1080
TabIndex = 5
Top = 480
Width = 1215
End
End
Attribute VB_Name = "frmtdtzb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sql1 As String
Dim sql2 As String
Dim sql3 As String
Dim RS As ADODB.Recordset
Private Sub command1_Click(Index As Integer)
Call Open_link
sql1 = "select max(id) from xdgl_yhtzb"
Set RS = ZHCX.Execute(sql1, 0)
If Not IsNull(RS(0)) Then
ID = RS(0) + 1
Else
ID = 1
End If
If RS.State Then
RS.Close
End If
Adodc1.Recordset.AddNew
DataGrid1.Columns(0).Value = ID
DataGrid1.Columns(1).Value = Format(DTPicker1.Value, "yyyy-mm-dd") + " " + Format(Now, "hh:mm")
DataGrid1.Columns(2).Value = Format(DTPicker1.Value, "yyyy-mm-dd") + " " + Format(Now, "hh:mm")
DataGrid1.Columns(3).Value = Format(DTPicker1.Value, "yyyy-mm-dd") + " " + Format(Now, "hh:mm")
DataGrid1.Columns(5).Value = cname
Adodc1.Recordset.Update
Adodc1.Refresh
Call Close_link
Call c_Load
End Sub
Sub c_Load()
DataGrid1.Columns(0).Caption = "序号"
DataGrid1.Columns(0).Width = 500
DataGrid1.Columns(1).Caption = "通知时间"
DataGrid1.Columns(1).Width = 2300
DataGrid1.Columns(2).Caption = "停电时间"
DataGrid1.Columns(2).Width = 2300
DataGrid1.Columns(3).Caption = "复电时间"
DataGrid1.Columns(3).Width = 2300
DataGrid1.Columns(4).Caption = "线路名称"
DataGrid1.Columns(5).Caption = "值班员"
DataGrid1.Columns(6).Caption = "通知对象"
DataGrid1.Columns(7).Visible = False
DataGrid1.Columns(8).Caption = "性质"
DataGrid1.Columns(9).Caption = "电压等级"
End Sub
Private Sub Command2_Click(Index As Integer)
If Adodc1.Recordset.EOF Then
Exit Sub
End If
A = MsgBox("是否确认删除该记录", vbYesNo)
If A = 6 Then
If Not Adodc1.Recordset.EOF Then
Adodc1.Recordset.Delete
End If
End If
Adodc1.Recordset.Update
Adodc1.Refresh
Call c_Load
End Sub
Private Sub Command3_Click()
sql1 = "select * from xdgl_yhtzb where tzsj BETWEEN '" & DTPicker1.Value & "' and '" & DTPicker2.Value & "' order by id"
Adodc1.RecordSource = sql1
Adodc1.Refresh
Call c_Load
End Sub
Private Sub Command4_Click()
Dim myxlsapp As Excel.Application
Set myxlsapp = CreateObject("Excel.Application")
myxlsapp.Visible = True
myxlsapp.Workbooks.Add
Sql = Adodc1.RecordSource
Debug.Print
Call Open_link
Set RS = ZHCX.Execute(Sql, 1)
If RS.EOF Then
Else
myxlsapp.Cells(1, 1).Value = "用户停电通知统计表"
'myxlsapp.Cells(1, 10).Value = "TY-SJ-177"
myxlsapp.Cells(2, 1).Value = "序号"
myxlsapp.Cells(2, 2).Value = "通知时间"
myxlsapp.Cells(2, 3).Value = "停电时间"
myxlsapp.Cells(2, 4).Value = "复电时间"
myxlsapp.Cells(2, 5).Value = "线路名称"
myxlsapp.Cells(2, 6).Value = "值班员"
myxlsapp.Cells(2, 7).Value = "通知对象"
myxlsapp.Cells(2, 8).Value = "电压等级"
myxlsapp.Cells(2, 9).Value = "性质"
myxlsapp.Cells(2, 10).Value = "停电时长(分)"
myxlsapp.Columns("A:A").ColumnWidth = 4
myxlsapp.Columns("B:B").ColumnWidth = 14.5
myxlsapp.Columns("C:C").ColumnWidth = 14.5
myxlsapp.Columns("D:D").ColumnWidth = 14.5
myxlsapp.Columns("E:E").ColumnWidth = 13.8
myxlsapp.Columns("F:F").ColumnWidth = 8
myxlsapp.Columns("G:G").ColumnWidth = 8
myxlsapp.Columns("H:H").ColumnWidth = 8
myxlsapp.Columns("I:I").ColumnWidth = 8
myxlsapp.Columns("J:J").ColumnWidth = 12
myxlsapp.Columns("A:J").Select
With myxlsapp.Selection.Font
.Name = "宋体"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
myxlsapp.Range("A2:J2").Select
With myxlsapp.Selection.Interior
.ColorIndex = 42
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -