📄 addstu.frm
字号:
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 582
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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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 Adodc4
Height = 330
Left = 5520
Top = 0
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 582
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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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 Adodc5
Height = 330
Left = 7680
Top = 240
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 582
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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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.Label Label1
BackStyle = 0 'Transparent
Caption = "学号"
Height = 375
Left = 480
TabIndex = 13
Top = 480
Width = 855
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "性别"
Height = 375
Left = 3960
TabIndex = 12
Top = 960
Width = 855
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "班级"
Height = 375
Left = 480
TabIndex = 11
Top = 2280
Width = 855
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "系别"
Height = 375
Left = 480
TabIndex = 10
Top = 1920
Width = 855
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "学院"
Height = 375
Left = 480
TabIndex = 9
Top = 1440
Width = 855
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "姓名"
Height = 375
Left = 3960
TabIndex = 8
Top = 360
Width = 855
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "出生年月"
Height = 375
Left = 3960
TabIndex = 7
Top = 1440
Width = 855
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "入学日期"
Height = 375
Left = 480
TabIndex = 6
Top = 960
Width = 855
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "政治面貌"
Height = 375
Left = 3960
TabIndex = 5
Top = 1920
Width = 855
End
End
Attribute VB_Name = "addstu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_GotFocus()
Combo2.Clear
Combo3.Clear
End Sub
Private Sub Combo1_LostFocus()
Me.Adodc2.RecordSource = "select distinct depart_name from Manage_base where college_name='" & Me.Combo1.Text & "'"
Adodc2.Refresh
For i = 0 To Adodc2.Recordset.RecordCount - 1
Me.Combo2.AddItem (Adodc2.Recordset.Fields(0))
Adodc2.Recordset.MoveNext
Next i
End Sub
Private Sub Combo2_GotFocus()
Combo3.Clear
End Sub
Private Sub Combo2_LostFocus()
Me.Adodc3.RecordSource = "select distinct major_name from Manage_base where depart_name='" & Me.Combo2.Text & "'"
Adodc3.Refresh
For i = 0 To Adodc3.Recordset.RecordCount - 1
Me.Combo3.AddItem (Adodc3.Recordset.Fields(0))
Adodc3.Recordset.MoveNext
Next i
End Sub
Private Sub Command1_Click()
Me.Adodc4.RecordSource = "select * from Manage_user"
Adodc4.Refresh
If Not Adodc4.Recordset.EOF Then
Adodc4.Recordset.MoveLast
End If
Adodc4.Recordset.AddNew
If txtid.Text <> "" Then Adodc4.Recordset.Fields("user_id") = txtid.Text
If txtname.Text <> "" Then Adodc4.Recordset.Fields("user_name") = txtname.Text
If txtindate.Text <> "" Then Adodc4.Recordset.Fields("user_indate") = txtindate.Text
If cbsex.Text <> "" Then Adodc4.Recordset.Fields("user_sex") = cbsex.Text
If Combo1.Text <> "" Then Adodc4.Recordset.Fields("user_college") = Combo1.Text
If Me.DTPicker1.Value <> "" Then Adodc4.Recordset.Fields("user_birth") = DTPicker1.Value
If Combo2.Text <> "" Then Adodc4.Recordset.Fields("user_depart") = Combo2.Text
If cbtype.Text <> "" Then Adodc4.Recordset.Fields("user_status") = cbtype.Text
If Combo3.Text <> "" Then Adodc4.Recordset.Fields("user_major") = Combo3.Text
Adodc4.Recordset.Update
Me.DataGrid1.Refresh
End Sub
Private Sub Command2_Click()
txtid.Text = ""
txtindate.Text = ""
txtname.Text = ""
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = cnn()
Adodc2.ConnectionString = cnn()
Adodc3.ConnectionString = cnn()
Adodc4.ConnectionString = cnn()
Me.Adodc1.RecordSource = "select distinct college_name from Manage_base"
Adodc1.Refresh
For i = 0 To Adodc1.Recordset.RecordCount - 1
Me.Combo1.AddItem (Adodc1.Recordset.Fields(0))
Adodc1.Recordset.MoveNext
Next i
Me.Adodc5.ConnectionString = cnn()
Adodc5.RecordSource = "select user_id,user_name,user_sex,user_birth,user_indate,user_status,user_college,user_depart,user_major from Manage_user"
Adodc5.Refresh
'Me.DataGrid1.DataSource = Adodc1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -