📄 main_jcfx_xlfx.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"
Begin VB.Form main_jcfx_xlfx
BorderStyle = 1 'Fixed Single
Caption = "决策分析-【图书销量分析】"
ClientHeight = 7095
ClientLeft = 1080
ClientTop = 810
ClientWidth = 11715
Icon = "main_jcfx_xlfx.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 7095
ScaleWidth = 11715
StartUpPosition = 1 '所有者中心
Begin VB.OptionButton Option2
Caption = "线形显示"
Height = 255
Left = 9225
TabIndex = 8
Top = 6420
Width = 1170
End
Begin VB.OptionButton Option1
Caption = "条形显示"
Height = 345
Left = 9225
TabIndex = 7
Top = 5745
Width = 1125
End
Begin MSChart20Lib.MSChart msChart1
CausesValidation= 0 'False
Height = 5370
Left = 30
OleObjectBlob = "main_jcfx_xlfx.frx":0CCA
TabIndex = 0
Top = 30
Width = 11475
End
Begin MSAdodcLib.Adodc Adodc2
Height = 375
Left = 2280
Top = 180
Width = 1770
_ExtentX = 3122
_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= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=Nbooks"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "Nbooks"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from tslbb"
Caption = "Adodc2"
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 MSAdodcLib.Adodc Adodc1
Height = 405
Left = 240
Top = 180
Width = 1875
_ExtentX = 3307
_ExtentY = 714
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= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=Nbooks"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "Nbooks"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from xsb"
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.Frame Frame1
Caption = "销售排行列表"
Height = 1500
Left = 90
TabIndex = 2
Top = 5490
Width = 8895
Begin MSDataGridLib.DataGrid DataGrid1
Height = 1155
Left = 105
TabIndex = 3
Top = 225
Width = 8700
_ExtentX = 15346
_ExtentY = 2037
_Version = 393216
AllowUpdate = 0 'False
BackColor = 12713963
HeadLines = 1
RowHeight = 14
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
End
Begin VB.Frame Frame2
Height = 675
Left = 690
TabIndex = 4
Top = 945
Width = 8295
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "main_jcfx_xlfx.frx":271C
Height = 330
Left = 1905
TabIndex = 6
Top = 285
Width = 5895
_ExtentX = 10398
_ExtentY = 582
_Version = 393216
ListField = "类别名称"
Text = ""
End
Begin VB.Label Label1
Caption = "选择图书类别"
Height = 255
Left = 600
TabIndex = 5
Top = 285
Width = 1215
End
End
Begin VB.CommandButton Command1
Caption = "退出"
Height = 855
Left = 10575
TabIndex = 1
Top = 5715
Width = 1005
End
End
Attribute VB_Name = "main_jcfx_xlfx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Private Sub Form_Load()
Adodc1.ConnectionString = "DSN=NBooks"
Adodc1.RecordSource = "select * from xsb"
Adodc1.Refresh
Adodc2.ConnectionString = "DSN=NBooks"
Adodc2.RecordSource = "select * from tslbb"
Adodc2.Refresh
Set rs1 = New ADODB.Recordset
rs1.Open "select top 20 书名,sum(销售数量)as 合计销售数量 from xsb where year(日期)='" + Format(Date, "yyyy") + "'and month(日期)='" + Format(Date, "mm") + "' group by 书名,出版社 order by 2 desc", Cnn, adOpenKeyset, adLockOptimistic
With msChart1
.ShowLegend = True
.Title.text = " " & Year(Date) & "年" & Month(Date) & "月份 " & DataCombo1.text & "图书销量排行(前20名) " '设置图表名称
.Title.VtFont.Size = 12 '设置字体大小
.Title.VtFont.VtColor.Set 255, 0, 0 '设置字体颜色
End With
Set msChart1.DataSource = rs1
If rs1.RecordCount > 0 Then
rs1.MoveFirst
Set msChart1.DataSource = rs1
msChart1.ColumnLabel = "本月图书销售数量"
End If
rs1.Close
Adodc1.RecordSource = "select top 20 书名,sum(销售数量)as 合计销售数量 from xsb where year(日期)='" + Format(Date, "yyyy") + "'and month(日期)='" + Format(Date, "mm") + "' group by 书名,出版社 order by 合计销售数量 desc "
'Left 函数返回 Variant (String),其中包含字符串中从左边算起指定数量的字符。
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Columns(0).Width = 3100
DataGrid1.Columns(1).Width = 1500
End Sub
Private Sub DataCombo1_Click(Area As Integer)
Form_Load
End Sub
Private Sub Command1_Click()
frm_main.Enabled = True
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub Option1_Click()
msChart1.chartType = VtChChartType2dBar '条型显示
End Sub
Private Sub Option2_Click()
msChart1.chartType = VtChChartType2dLine '线形显示
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -