📄 xibiezhuce.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 XIBIEFORM
BorderStyle = 1 'Fixed Single
Caption = "系别注册---计算中心上机收费系统"
ClientHeight = 5910
ClientLeft = 45
ClientTop = 330
ClientWidth = 6240
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5910
ScaleWidth = 6240
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Height = 1215
Left = 120
TabIndex = 2
Top = 0
Width = 6015
Begin VB.CommandButton Command4
Caption = "保存"
Height = 375
Left = 4920
TabIndex = 10
Top = 720
Width = 735
End
Begin VB.CommandButton Command3
Caption = "删除"
Height = 375
Left = 4080
TabIndex = 9
Top = 720
Width = 735
End
Begin VB.TextBox xbmc
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 = 720
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "注册"
Height = 375
Left = 4080
TabIndex = 5
Top = 240
Width = 735
End
Begin VB.ComboBox XUEYUANXIALA
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
ItemData = "XIBIEZHUCE.frx":0000
Left = 1680
List = "XIBIEZHUCE.frx":0002
TabIndex = 4
Top = 240
Width = 2175
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 4920
TabIndex = 3
Top = 240
Width = 735
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 = 4575
Left = 120
TabIndex = 0
Top = 1200
Width = 6015
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "XIBIEZHUCE.frx":0004
Height = 4215
Left = 120
TabIndex = 1
Top = 240
Width = 5775
_ExtentX = 10186
_ExtentY = 7435
_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
ColumnCount = 3
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
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 1305.071
EndProperty
BeginProperty Column01
ColumnWidth = 2085.166
EndProperty
BeginProperty Column02
ColumnWidth = 2085.166
EndProperty
EndProperty
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 120
Top = 4080
Visible = 0 'False
Width = 5775
_ExtentX = 10186
_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 = "XIBIEFORM"
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 Command1_Click()
If Len(xbmc.Text) = 0 Then
MsgBox "必须填写系别名称!"
xbmc.SetFocus
Exit Sub
End If
If XUEYUANXIALA.ListIndex = -1 Then
MsgBox "必须选择所属学院!"
XUEYUANXIALA.SetFocus
Exit Sub
End If
xbm = xbmc.Text
ssxy = XUEYUANXIALA.List(XUEYUANXIALA.ListIndex)
sql = "select * from 学院表 where 学院名称='" & ssxy & "'"
Set rs = conn.Execute(sql)
ssxq = rs("所属校区")
Adodc1.Recordset.AddNew
Adodc1.Recordset("系别名称") = xbm
Adodc1.Recordset("所属学院") = ssxy
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(xbmc.Text) = 0 Then
MsgBox "必须填写系别名称!"
xbmc.SetFocus
Exit Sub
End If
If XUEYUANXIALA.ListIndex = -1 Then
MsgBox "必须选择所属学院!"
XUEYUANXIALA.SetFocus
Exit Sub
End If
xbm = xbmc.Text
ssxy = XUEYUANXIALA.List(XUEYUANXIALA.ListIndex)
sql = "select * from 学院表 where 学院名称='" & ssxy & "'"
Set rs = conn.Execute(sql)
ssxq = rs("所属校区")
Adodc1.Recordset("系别名称") = xbm
Adodc1.Recordset("所属学院") = ssxy
Adodc1.Recordset("所属校区") = ssxq
Adodc1.Recordset.Update
Adodc1.Refresh
End Sub
Private Sub Form_Load()
conn.Open connstr
sql = "select * from 学院表 order by id desc"
Set rs = conn.Execute(sql)
If rs.EOF Or rs.BOF Then
MsgBox "请首先注册学院名称!"
zhuceform.Show 1
Else
Do While Not rs.EOF
XUEYUANXIALA.AddItem rs("学院名称")
rs.MoveNext
Loop
XUEYUANXIALA.ListIndex = 0
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set rs = Nothing
Set conn = Nothing
End Sub
Private Sub xbmc_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -