📄 frmaddchange.frm
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form FrmAddChange
BackColor = &H00FFC0C0&
Caption = "学籍变更管理"
ClientHeight = 5130
ClientLeft = 60
ClientTop = 420
ClientWidth = 8580
ForeColor = &H00FFFFFF&
LinkTopic = "Form3"
ScaleHeight = 5130
ScaleWidth = 8580
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton CmdCancel
BackColor = &H00FF8080&
Caption = "取消"
Height = 450
Left = 4560
MaskColor = &H00FFFFC0&
TabIndex = 8
Top = 4440
Width = 975
End
Begin VB.CommandButton CmdAppend
BackColor = &H80000014&
Caption = "添加"
Height = 450
Left = 2640
TabIndex = 7
Top = 4440
Width = 975
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "学生基本情况"
Height = 2415
Left = 3720
TabIndex = 6
Top = 120
Width = 4215
Begin VB.Label lblName
BackColor = &H00FFC0C0&
Caption = "姓名:"
Height = 300
Left = 480
TabIndex = 11
Top = 480
Width = 1215
End
Begin VB.Label lblDepartment
BackColor = &H00FFC0C0&
Caption = "院系:"
Height = 300
Left = 480
TabIndex = 10
Top = 1080
Width = 1215
End
Begin VB.Label lblClass
BackColor = &H00FFC0C0&
Caption = "班级:"
Height = 300
Left = 480
TabIndex = 9
Top = 1800
Width = 1215
End
End
Begin VB.TextBox txtMemo
BackColor = &H80000009&
Height = 1500
Left = 360
TabIndex = 5
Top = 2760
Width = 7575
End
Begin VB.TextBox txtStuNO
BackColor = &H80000009&
Height = 300
Left = 1800
TabIndex = 4
Top = 240
Width = 1575
End
Begin MSDataListLib.DataCombo DataCombo1
Height = 330
Left = 1800
TabIndex = 3
Top = 960
Width = 1575
_ExtentX = 2778
_ExtentY = 582
_Version = 393216
BackColor = -2147483639
Text = ""
End
Begin VB.Label Label3
BackColor = &H00FFC0C0&
Caption = "具体描述:"
Height = 300
Left = 360
TabIndex = 2
Top = 2160
Width = 1215
End
Begin VB.Label Label2
BackColor = &H00FFC0C0&
Caption = "学籍变更情况:"
Height = 300
Left = 360
TabIndex = 1
Top = 960
Width = 1455
End
Begin VB.Label Label1
BackColor = &H00FFC0C0&
Caption = "输入学号:"
Height = 300
Left = 360
TabIndex = 0
Top = 240
Width = 1215
End
End
Attribute VB_Name = "FrmAddChange"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strCnn As String
Dim cnn As New ADODB.Connection
Dim cmd As New ADODB.Command
Public strStuNO As String
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub Form_Load()
txtStuNO.Text = strStuNO
Set DataCombo1.RowSource = DataEnvironment1
DataCombo1.RowMember = "dbo_stu_GetChangeCode"
DataCombo1.ListField = "description"
DataEnvironment1.rsdbo_stu_GetChangeCode.MoveFirst
DataCombo1.Text = DataEnvironment1.rsdbo_stu_GetChangeCode("Description").Value
If strStuNO <> "" Then
Set cnn = New ADODB.Connection
Dim rs As New ADODB.Recordset
Set cmd = New ADODB.Command
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=学生信息管理系统;Data Source=飞扬社区"
cnn.Open strCnn
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "stu_GetStuSummary2"
cmd.Parameters.Append cmd.CreateParameter("@stuNO", adChar, adParamInput, 6)
cmd.Parameters.Append cmd.CreateParameter("@stuName", adVarChar, adParamOutput, 20)
cmd.Parameters.Append cmd.CreateParameter("@departName", adVarChar, adParamOutput, 50)
cmd.Parameters.Append cmd.CreateParameter("@className", adVarChar, adParamOutput, 50)
'cmd.Parameters.Refresh
cmd.Parameters("@stuNO").Value = txtStuNO.Text
Set rs.Source = cmd
rs.Open
Set rs = cmd.Execute
lblName.Caption = cmd("@stuName")
lblDepartment.Caption = cmd("@departName")
lblClass.Caption = cmd("@className")
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
'cnn.Close
Set cnn = Nothing
End Sub
Private Sub Append()
On Error GoTo ErrHandle
Dim rs As New ADODB.Recordset
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "stu_AddChangeRecord"
cmd.Parameters.Append cmd.CreateParameter("@stuNO", adChar, adParamInput, 6)
cmd.Parameters.Append cmd.CreateParameter("@changeDes", adVarChar, adParamInput, 50)
cmd.Parameters.Append cmd.CreateParameter("@memo", adVarChar, adParamInput, 1000)
cmd.Parameters("@stuNO").Value = txtStuNO.Text
cmd.Parameters("@changeDes").Value = DataCombo1.Text
cmd.Parameters("@memo").Value = txtMemo.Text
cmd.Execute
MsgBox "添加成功!"
Exit Sub
ErrHandle:
MsgBox Err.Description
End Sub
Private Sub CmdAppend_Click()
Append
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -