📄 frm_timefenxi.frm
字号:
VERSION 5.00
Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form UfrmTimeFenXi
BorderStyle = 1 'Fixed Single
Caption = "客户洽谈时刻分析"
ClientHeight = 6480
ClientLeft = 45
ClientTop = 330
ClientWidth = 7470
ControlBox = 0 'False
Icon = "frm_TimeFenXi.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6480
ScaleWidth = 7470
Begin VB.CommandButton Command10
Caption = "日分析"
Height = 255
Left = 6480
TabIndex = 10
Top = 2010
Width = 855
End
Begin VB.CommandButton Command9
Caption = "月分析"
Height = 255
Left = 6480
TabIndex = 9
Top = 2325
Width = 855
End
Begin VB.CommandButton Command7
Caption = "柱图(&Z)"
Height = 255
Left = 6480
TabIndex = 8
Top = 1380
Width = 855
End
Begin VB.CommandButton Command6
Caption = "线图(&L)"
Height = 255
Left = 6480
TabIndex = 7
Top = 1065
Width = 855
End
Begin VB.CommandButton Command5
Caption = "饼图(&B)"
Height = 255
Left = 6480
TabIndex = 6
Top = 750
Width = 855
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 255
Left = 6480
TabIndex = 5
Top = 120
Width = 855
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 255
Left = 6480
TabIndex = 4
Top = 435
Width = 855
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 255
Left = 6480
TabIndex = 3
Top = 2640
Width = 855
End
Begin VB.CommandButton Command4
Caption = "时分析"
Default = -1 'True
Height = 255
Left = 6480
TabIndex = 2
Top = 1695
Width = 855
End
Begin MSChart20Lib.MSChart MSChart1
Height = 3135
Left = 240
OleObjectBlob = "frm_TimeFenXi.frx":0CCA
TabIndex = 1
Top = 3120
Width = 6975
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 2775
Left = 120
TabIndex = 0
Top = 120
Width = 6255
_ExtentX = 11033
_ExtentY = 4895
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
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 VB.Line Line4
X1 = 120
X2 = 7320
Y1 = 6360
Y2 = 6360
End
Begin VB.Line Line3
X1 = 7320
X2 = 7320
Y1 = 3000
Y2 = 6360
End
Begin VB.Line Line2
X1 = 120
X2 = 7320
Y1 = 3000
Y2 = 3000
End
Begin VB.Line Line1
X1 = 120
X2 = 120
Y1 = 3000
Y2 = 6360
End
End
Attribute VB_Name = "UfrmTimeFenXi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
UfrmAddTime.Show
End Sub
Private Sub Command10_Click()
'On Error Resume Next
Me.MousePointer = 11
Dim TimeFenXi(1 To 31, 1 To 3)
Dim Cn As New Connection
Dim Fbwt_Rs As New Recordset
Call ConnectDataBase
Cn.Open cnDataBase_GivePower
Cn.CursorLocation = adUseClient
For i = 1 To 31
TimeFenXi(i, 1) = str(i) + "日"
Fbwt_Rs.Open "select count(*) from timefen where 日='" & i & "'", Cn, adOpenStatic
TimeFenXi(i, 2) = Fbwt_Rs.Fields(0).Value
Fbwt_Rs.Close
Fbwt_Rs.Open "select count(*) from timefen", Cn, adOpenStatic
TimeFenXi(i, 3) = Fbwt_Rs.Fields(0).Value
Fbwt_Rs.Close
Next
MSChart1.ChartData = TimeFenXi
MSChart1.ColumnCount = 2
MSChart1.Column = 1
MSChart1.ColumnLabel = "日访问量"
MSChart1.Column = 2
MSChart1.ColumnLabel = "所有总量"
Me.MousePointer = 0
End Sub
Private Sub Command2_Click()
'On Error Resume Next
fbwtfanb = MsgBox("你确信要删除这条记录吗?", vbInformation + vbYesNo, "提示")
If fbwtfanb = 7 Then
Exit Sub
End If
Me.MousePointer = 11
Dim Cn As New Connection
Dim Fbwt_Rs As New Recordset
Call ConnectDataBase
Cn.Open cnDataBase_GivePower
Cn.CursorLocation = adUseClient
Cn.CursorLocation = adUseClient
Cn.Open fbwt_ConnectData
Cn.Execute "delete * from timefen where 客户='" & DataGrid1.Columns(0).Text & "' and 年='" & DataGrid1.Columns(1).Text & "' and 月='" & DataGrid1.Columns(2).Text & "' and 日='" & DataGrid1.Columns(3).Text & "' and 小时='" & DataGrid1.Columns(4).Text & "' and 分钟='" & DataGrid1.Columns(5).Text & "'"
MsgBox ("成功删除!"), vbInformation
Fbwt_Rs.Open "select * from timefen", Cn, adOpenStatic
Set DataGrid1.DataSource = Fbwt_Rs
Me.MousePointer = 0
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
'On Error Resume Next
Me.MousePointer = 11
Dim TimeFenXi(0 To 23, 1 To 3)
Dim Cn As New Connection
Dim Fbwt_Rs As New Recordset
Call ConnectDataBase
Cn.Open cnDataBase_GivePower
Cn.CursorLocation = adUseClient
For i = 0 To 23
TimeFenXi(i, 1) = str(i) + "时"
Fbwt_Rs.Open "select count(*) from timefen where 小时='" & i & "'", Cn, adOpenStatic
TimeFenXi(i, 2) = Fbwt_Rs.Fields(0).Value
Fbwt_Rs.Close
Fbwt_Rs.Open "select count(*) from timefen", Cn, adOpenStatic
TimeFenXi(i, 3) = Fbwt_Rs.Fields(0).Value
Fbwt_Rs.Close
Next
MSChart1.ChartData = TimeFenXi
MSChart1.ColumnCount = 2
MSChart1.Column = 1
MSChart1.ColumnLabel = "时访问量"
MSChart1.Column = 2
MSChart1.ColumnLabel = "所有总量"
Me.MousePointer = 0
End Sub
Private Sub Command5_Click()
MSChart1.chartType = 14
End Sub
Private Sub Command6_Click()
MSChart1.chartType = VtChChartType2dLine
End Sub
Private Sub Command7_Click()
MSChart1.chartType = VtChChartType2dBar
End Sub
Private Sub Command8_Click()
MSChart1.chartType = 0
End Sub
Private Sub Command9_Click()
'On Error Resume Next
Me.MousePointer = 11
Dim MonthFenXi(1 To 12, 1 To 3)
Dim Cn As New Connection
Dim Fbwt_Rs As New Recordset
Call ConnectDataBase
Cn.Open cnDataBase_GivePower
Cn.CursorLocation = adUseClient
For i = 1 To 12
MonthFenXi(i, 1) = str(i) + "月"
Fbwt_Rs.Open "select count(*) from timefen where 月='" & i & "'", Cn, adOpenStatic
MonthFenXi(i, 2) = Fbwt_Rs.Fields(0).Value
Fbwt_Rs.Close
Fbwt_Rs.Open "select count(*) from timefen", Cn, adOpenStatic
MonthFenXi(i, 3) = Fbwt_Rs.Fields(0).Value
Fbwt_Rs.Close
Next
MSChart1.ChartData = MonthFenXi
MSChart1.ColumnCount = 2
MSChart1.Column = 1
MSChart1.ColumnLabel = "月访问量"
MSChart1.Column = 2
MSChart1.ColumnLabel = "所有总量"
Me.MousePointer = 0
End Sub
Private Sub Form_Load()
'On Error Resume Next
Me.MousePointer = 11
Dim Cn As New Connection
Dim Fbwt_Rs As New Recordset
Call ConnectDataBase
Cn.Open cnDataBase_GivePower
Cn.CursorLocation = adUseClient
Fbwt_Rs.Open "select * from timefen ", Cn, adOpenStatic
Set DataGrid1.DataSource = Fbwt_Rs
Me.MousePointer = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -