?? frmaddpunish.frm
字號(hào):
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form FrmAddPunish
Caption = "處理情況輸入"
ClientHeight = 5520
ClientLeft = 60
ClientTop = 450
ClientWidth = 6300
LinkTopic = "Form1"
ScaleHeight = 5520
ScaleWidth = 6300
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "顯示"
Height = 255
Left = 3960
TabIndex = 15
Top = 120
Width = 735
End
Begin VB.CommandButton CmdCancel
Caption = "取消"
Height = 375
Left = 3000
TabIndex = 14
Top = 5040
Width = 1455
End
Begin VB.CommandButton CmdAppend
Caption = "添加"
Height = 375
Left = 600
TabIndex = 13
Top = 5040
Width = 1215
End
Begin VB.TextBox txtMemo
Height = 2175
Left = 120
TabIndex = 12
Top = 2640
Width = 6015
End
Begin VB.Frame Frame1
Caption = "學(xué)生基本情況"
Height = 1815
Left = 2640
TabIndex = 4
Top = 360
Width = 3495
Begin VB.Label IblClass
Caption = "IblClass"
Height = 375
Left = 1080
TabIndex = 11
Top = 1320
Width = 2175
End
Begin VB.Label IblDepartment
Caption = "IblDepartment"
Height = 495
Left = 1080
TabIndex = 10
Top = 720
Width = 1335
End
Begin VB.Label IblName
Caption = "IbName"
Height = 375
Left = 1080
TabIndex = 9
Top = 240
Width = 1215
End
Begin VB.Label IblClass1
Caption = "班級(jí):"
Height = 495
Left = 120
TabIndex = 8
Top = 1440
Width = 735
End
Begin VB.Label IblDepartment1
Caption = "院系:"
Height = 375
Left = 120
TabIndex = 7
Top = 840
Width = 735
End
Begin VB.Label IblName1
Caption = "姓名:"
Height = 375
Left = 120
TabIndex = 6
Top = 240
Width = 855
End
End
Begin MSDataListLib.DataCombo DataCombo1
Height = 330
Left = 1200
TabIndex = 3
Top = 1200
Width = 1455
_ExtentX = 2566
_ExtentY = 582
_Version = 393216
Text = "DataCombo1"
End
Begin VB.TextBox txtStuNo
Height = 375
Left = 1200
TabIndex = 1
Text = "100001"
Top = 240
Width = 1335
End
Begin VB.Label Label3
Caption = "具體描述"
Height = 375
Left = 0
TabIndex = 5
Top = 2160
Width = 735
End
Begin VB.Label Label2
Caption = "處罰級(jí)別"
Height = 495
Left = 0
TabIndex = 2
Top = 1200
Width = 1215
End
Begin VB.Label Labell
Caption = "輸入學(xué)號(hào)"
Height = 375
Left = 120
TabIndex = 0
Top = 240
Width = 975
End
End
Attribute VB_Name = "FrmAddPunish"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strCnn As String
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
Public strStuNo As String '當(dāng)前記錄學(xué)號(hào)
Private Sub Command1_Click()
strStuNo = txtStuNo.Text
'填充處罰等級(jí)下拉列表
Set DataCombo1.RowSource = DataEnvironment1
DataCombo1.RowMember = "dbo_stu_GetPunishCode"
DataCombo1.ListField = "description"
DataEnvironment1.rsdbo_stu_GetPunishCode.MoveFirst
DataCombo1.Text = DataEnvironment1.rsdbo_stu_GetPunishCode("Description").Value
'在LABEL中顯示學(xué)生基本情況
If strStuNo <> " " Then
Set cnn = New ADODB.Connection
Dim Rs As New Recordset
Set cmd = New ADODB.Command
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial catalog=學(xué)生信息管理系統(tǒng);data source=556337A19B704A1"
cnn.Open strCnn
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "stu_GetStuSummary"
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
IblName.Caption = cmd("@stuName")
IblDepartment.Caption = cmd("@departname")
IblClass.Caption = cmd("@className")
End If
End Sub
Private Sub Form_load()
If DataEnvironment1.Connection1.State <> adStateOpen Then
DataEnvironment1.Connection1.Open
End If
strStuNo = "100001"
txtStuNo.Text = strStuNo
'填充處罰等級(jí)下拉列表
Set DataCombo1.RowSource = DataEnvironment1
DataCombo1.RowMember = "dbo_stu_GetPunishCode"
DataCombo1.ListField = "description"
DataEnvironment1.rsdbo_stu_GetPunishCode.MoveFirst
DataCombo1.Text = DataEnvironment1.rsdbo_stu_GetPunishCode("Description").Value
'在LABEL中顯示學(xué)生基本情況
If strStuNo <> " " Then
Set cnn = New ADODB.Connection
Dim Rs As New Recordset
Set cmd = New ADODB.Command
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial catalog=學(xué)生信息管理系統(tǒng);data source=556337A19B704A1"
cnn.Open strCnn
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "stu_GetStuSummary"
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
IblName.Caption = cmd("@stuName")
IblDepartment.Caption = cmd("@departname")
IblClass.Caption = cmd("@className")
End If
End Sub
Private Sub Form_Unload(cancel As Integer)
If cnn.State = adStateOpen Then
cnn.Close
Set cnn = Nothing
End If
End Sub
Private Sub Append()
'添加處罰記錄
Set cnn = New ADODB.Connection
Set cmd = New ADODB.Command
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial catalog=學(xué)生信息管理系統(tǒng);data source=556337A19B704A1"
cnn.Open strCnn
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "stu_AddPunishRecord"
cmd.Parameters.Append cmd.CreateParameter("@studentNo", adChar, adParamInput, 6)
cmd.Parameters.Append cmd.CreateParameter("@Des", adVarChar, adParamInput, 50)
cmd.Parameters.Append cmd.CreateParameter("@memo", adVarChar, adParamInput, 1000)
cmd.Parameters("@studentNo").Value = txtStuNo.Text
cmd.Parameters("@Des").Value = DataCombo1.Text
cmd.Parameters("@memo").Value = txtMemo.Text
cmd.Execute
MsgBox "添加成功!"
Exit Sub
End Sub
Private Sub CmdAppend_Click()
Append
End Sub
Private Sub Cmdcancel_click()
Unload Me
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -