📄 banjiform.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"
Begin VB.Form banjiform
BorderStyle = 1 'Fixed Single
Caption = "班级注册---计算中心上机收费系统"
ClientHeight = 5985
ClientLeft = 45
ClientTop = 330
ClientWidth = 6210
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5985
ScaleWidth = 6210
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Height = 1695
Left = 120
TabIndex = 2
Top = 0
Width = 6015
Begin VB.CommandButton Command4
Caption = "更改"
Height = 375
Left = 5040
TabIndex = 12
Top = 720
Width = 855
End
Begin VB.CommandButton Command3
Caption = "删除"
Height = 375
Left = 4080
TabIndex = 11
Top = 720
Width = 855
End
Begin VB.ComboBox ssxb
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1680
TabIndex = 10
Top = 720
Width = 2175
End
Begin VB.TextBox bjmc
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 6
Top = 1200
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "注册"
Height = 375
Left = 4080
TabIndex = 5
Top = 240
Width = 855
End
Begin VB.ComboBox sxxy
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1680
TabIndex = 4
Top = 240
Width = 2175
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 5040
TabIndex = 3
Top = 240
Width = 855
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "班级名称:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 2
Left = 240
TabIndex = 9
Top = 1200
Width = 1380
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "所属系别:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 0
Left = 240
TabIndex = 8
Top = 720
Width = 1380
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "所属学院:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 1
Left = 240
TabIndex = 7
Top = 240
Width = 1380
End
End
Begin VB.Frame Frame2
Height = 4215
Left = 120
TabIndex = 0
Top = 1680
Width = 6015
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "banjiform.frx":0000
Height = 3855
Left = 120
TabIndex = 1
Top = 240
Width = 5775
_ExtentX = 10186
_ExtentY = 6800
_Version = 393216
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
ColumnCount = 4
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
BeginProperty Column02
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 Column03
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
ColumnWidth = 1170.142
EndProperty
BeginProperty Column01
ColumnWidth = 1425.26
EndProperty
BeginProperty Column02
ColumnWidth = 1590.236
EndProperty
BeginProperty Column03
ColumnWidth = 2085.166
EndProperty
EndProperty
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 120
Top = 5400
Visible = 0 'False
Width = 5295
_ExtentX = 9340
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 2
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=nccc.mdb"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=nccc.mdb"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 班级表 order by id desc"
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
End
Attribute VB_Name = "banjiform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub bjmc_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub
Private Sub Command1_Click()
If Len(bjmc.Text) = 0 Then
MsgBox "必须填写学院名称!"
bjmc.SetFocus
Exit Sub
End If
If sxxy.ListIndex = -1 Then
MsgBox "必须选择所属学院!"
sxxy.SetFocus
Exit Sub
End If
If ssxb.ListIndex = -1 Then
MsgBox "必须选择所属系别!"
ssxb.SetFocus
Exit Sub
End If
bjmctext = bjmc.Text
sxxytext = sxxy.List(sxxy.ListIndex)
ssxbtext = ssxb.List(ssxb.ListIndex)
sql = "select * from 系别表 where 系别名称='" & ssxbtext & "' and 所属学院 ='" & sxxytext & "'"
Set rs = conn.Execute(sql)
If rs.EOF Or rs.BOF Then
MsgBox "输入错误!"
Set rs = Nothing
Exit Sub
End If
ssxq = rs("所属校区")
Set rs = Nothing
Adodc1.Recordset.AddNew
Adodc1.Recordset("班级名称") = bjmctext
Adodc1.Recordset("所属系") = ssxbtext
Adodc1.Recordset("所属院") = sxxytext
Adodc1.Recordset("所属校区") = ssxq
Adodc1.Recordset.Update
Adodc1.Refresh
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
If Adodc1.Recordset.EOF Then Exit Sub
Adodc1.Recordset.Delete
Adodc1.Refresh
End Sub
Private Sub Command4_Click()
If Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF Then Exit Sub
If Len(bjmc.Text) = 0 Then
MsgBox "必须填写学院名称!"
bjmc.SetFocus
Exit Sub
End If
If sxxy.ListIndex = -1 Then
MsgBox "必须选择所属学院!"
sxxy.SetFocus
Exit Sub
End If
If ssxb.ListIndex = -1 Then
MsgBox "必须选择所属系别!"
ssxb.SetFocus
Exit Sub
End If
bjmctext = bjmc.Text
sxxytext = sxxy.List(sxxy.ListIndex)
ssxbtext = ssxb.List(ssxb.ListIndex)
sql = "select * from 系别表 where 系别名称='" & ssxbtext & "' and 所属学院 ='" & sxxytext & "'"
Set rs = conn.Execute(sql)
If rs.EOF Or rs.BOF Then
MsgBox "输入错误!"
Set rs = Nothing
Exit Sub
End If
ssxq = rs("所属校区")
Set rs = Nothing
Adodc1.Recordset("班级名称") = bjmctext
Adodc1.Recordset("所属系") = ssxbtext
Adodc1.Recordset("所属院") = sxxytext
Adodc1.Recordset("所属校区") = ssxq
Adodc1.Recordset.Update
Adodc1.Refresh
End Sub
Private Sub Form_Load()
conn.Open connstr
sql = "select * from 学院表"
Set rs = conn.Execute(sql)
If rs.EOF Or rs.BOF Then
MsgBox "没有注册学院信息,请首先注册学院信息!"
Else
Do While Not rs.EOF
sxxy.AddItem rs("学院名称")
rs.MoveNext
Loop
sxxy.ListIndex = 0
Set rs = Nothing
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set rs = Nothing
Set conn = Nothing
End Sub
Private Sub sxxy_LostFocus()
temp = sxxy.List(sxxy.ListIndex)
sql = "select * from 系别表 where 所属学院 ='" & temp & "'"
Set rs = conn.Execute(sql)
If rs.EOF Or rs.BOF Then
temp = MsgBox("该院尚未有系注册,注册该系?", vbYesNo)
If temp = vbYes Then
Unload Me
XIBIEFORM.Show 1
Exit Sub
End If
sxxy.SetFocus
Set rs = Nothing
Exit Sub
End If
ssxb.Clear
i = 0
Do While Not rs.EOF
ssxb.List(i) = rs("系别名称")
i = i + 1
rs.MoveNext
Loop
ssxb.ListIndex = 0
Set rs = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -