📄 主窗口.frm
字号:
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 1
Top = 8880
Width = 1455
End
Begin MSDataGridLib.DataGrid DG1
Bindings = "主窗口.frx":002A
Height = 4455
Left = 240
TabIndex = 0
Top = 240
Width = 4335
_ExtentX = 7646
_ExtentY = 7858
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
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
Caption = "学生信息"
ColumnCount = 2
BeginProperty Column00
DataField = "no"
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 = "name"
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 = 2400
Top = 4320
Visible = 0 'False
Width = 2175
_ExtentX = 3836
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=student;Data Source=127.0.0.1"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=student;Data Source=127.0.0.1"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "base"
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 MSAdodcLib.Adodc Adodc2
Height = 375
Left = 7320
Top = 4320
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=student;Data Source=127.0.0.1"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=student;Data Source=127.0.0.1"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "count"
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 Adodc3
Height = 375
Left = 12120
Top = 4320
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=student;Data Source=127.0.0.1"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=student;Data Source=127.0.0.1"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "info"
Caption = "Adodc3"
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 MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 495
Left = 0
TabIndex = 24
Top = 9015
Width = 14295
_ExtentX = 25215
_ExtentY = 873
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
EndProperty
End
Begin VB.Menu system
Caption = "系统"
Begin VB.Menu exit
Caption = "退出"
End
End
Begin VB.Menu putin
Caption = "信息输入与编辑"
Begin VB.Menu import
Caption = "从EXCEL导入"
End
Begin VB.Menu edit
Caption = "单个输入或修改"
End
End
Begin VB.Menu add_money
Caption = "充值"
End
Begin VB.Menu set_vip
Caption = "设置免费上机"
End
Begin VB.Menu view
Caption = "查看"
Begin VB.Menu student
Caption = "学生使用记录"
End
End
Begin VB.Menu class_manage
Caption = "班级管理"
Begin VB.Menu add
Caption = "新增"
End
Begin VB.Menu delete
Caption = "删除"
End
End
Begin VB.Menu sysedit
Caption = "系统信息修改"
End
Begin VB.Menu help
Caption = "帮助"
Begin VB.Menu about
Caption = "关于"
End
Begin VB.Menu Matter
Caption = "内容"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public db As Connection '数据库
Public rec_base As Recordset '基本信息
Public rec_count As ADODB.Recordset '账户
Public rec_info As ADODB.Recordset '其他信息,包括密码
Public rec_used As ADODB.Recordset '使用记录
Public rec_class As ADODB.Recordset '班级信息
Public rec_sysinfo As ADODB.Recordset '系统信息
Dim time As Integer '记时
Dim flag As Boolean '标记是否新记录
Dim V0 As Integer '标记充值金额
Dim Myinfo As String
Dim iseditting As Boolean '标记是否处于编辑状态
Private Sub about_Click()
Call ShellAbout(hWnd, "校园机房管理系统1.0", "浙江海洋学院 A03计算机(1)班 方旭", Me.Icon)
End Sub
Private Sub add_Click()
Form3.Show 1
End Sub
Private Sub add_money_Click()
edit_Click
Frame1.Caption = "充值"
Command4.Caption = "充值"
End Sub
Private Sub Command2_Click()
s = MsgBox("确定删除?", vbYesNo + vbInformation, "提示信息")
If s = vbYes Then
If rec_base.RecordCount <> 0 Then rec_base.delete adAffectCurrent
rec_info.Update
rec_count.Update
Else
dg1.Refresh
dg2.Refresh
dg4.Refresh
End If
End Sub
Private Sub Command3_Click()
rec_base.UpdateBatch
MsgBox "已保存!", vbInformation, "提示信息"
End Sub
Private Sub Command4_Click()
t2 = Text2.Text
t3 = Text3.Text
t6 = Text6.Text
T4 = Text4.Text
T5 = Text5.Text
If Text2.Text = "" Then Exit Sub
If flag = False Then '新学生,先增加记录
rec_base.AddNew
rec_info.AddNew
rec_count.AddNew
flag = True
Else '可能是旧学生,当前记录正是;也可能是没做判定
'作判定
Dim r_t As Recordset
Set r_t = New Recordset
With r_t
.ActiveConnection = db
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = 3
.Open "select * from base where no = " & Text2.Text
End With
If r_t.RecordCount <= 0 Then '不存在的学号,则通过输入回车的那个过程重新作数据修改
Text2_KeyPress (13)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -