⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ѧ

📁 这是本人应用VB在SQLsever2000环境下开发的新生信息管理系统
💻
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form FrmAddStudent 
   Caption         =   "输入学生资料"
   ClientHeight    =   5145
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4500
   LinkTopic       =   "Form1"
   ScaleHeight     =   5145
   ScaleWidth      =   4500
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   255
      Left            =   3240
      TabIndex        =   27
      Top             =   4800
      Width           =   975
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Height          =   255
      Left            =   2280
      TabIndex        =   26
      Top             =   4800
      Width           =   855
   End
   Begin VB.CommandButton cmdReset 
      Caption         =   "清空"
      Height          =   255
      Left            =   1320
      TabIndex        =   25
      Top             =   4800
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "输入下一条"
      Height          =   255
      Left            =   120
      TabIndex        =   24
      Top             =   4800
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Caption         =   "个人信息"
      Height          =   4575
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   4215
      Begin MSComCtl2.DTPicker dtpBirthday1 
         Height          =   375
         Left            =   2400
         TabIndex        =   28
         Top             =   1800
         Width           =   1215
         _ExtentX        =   2143
         _ExtentY        =   661
         _Version        =   393216
         Format          =   25296897
         CurrentDate     =   38880
      End
      Begin VB.Frame Frame2 
         Caption         =   "备注"
         Height          =   855
         Left            =   120
         TabIndex        =   22
         Top             =   3600
         Width           =   3975
         Begin VB.TextBox txtMemo 
            Height          =   495
            Left            =   120
            MultiLine       =   -1  'True
            TabIndex        =   23
            Top             =   240
            Width           =   3735
         End
      End
      Begin VB.TextBox txtEmail 
         Height          =   270
         Left            =   600
         TabIndex        =   21
         Top             =   3240
         Width           =   2895
      End
      Begin VB.TextBox txtAddress 
         Height          =   270
         Left            =   600
         TabIndex        =   19
         Top             =   2880
         Width           =   2895
      End
      Begin VB.TextBox txtzipcode 
         Height          =   375
         Left            =   2400
         TabIndex        =   17
         Top             =   2280
         Width           =   855
      End
      Begin VB.TextBox txtPhone 
         Height          =   375
         Left            =   600
         TabIndex        =   15
         Top             =   2400
         Width           =   975
      End
      Begin VB.TextBox txtNative 
         Height          =   270
         Left            =   600
         TabIndex        =   12
         Top             =   2040
         Width           =   975
      End
      Begin VB.TextBox txtClass 
         Height          =   270
         Left            =   2400
         TabIndex        =   10
         Top             =   1440
         Width           =   855
      End
      Begin VB.ComboBox cmbSex 
         Height          =   300
         ItemData        =   "学生资料输入模块.frx":0000
         Left            =   600
         List            =   "学生资料输入模块.frx":000A
         TabIndex        =   8
         Text            =   "男"
         Top             =   1560
         Width           =   975
      End
      Begin VB.TextBox txtDepartment 
         Height          =   375
         Left            =   600
         TabIndex        =   6
         Top             =   1080
         Width           =   975
      End
      Begin VB.TextBox txtName 
         Height          =   390
         Left            =   600
         TabIndex        =   4
         Top             =   600
         Width           =   975
      End
      Begin VB.TextBox txtID 
         Height          =   375
         Left            =   600
         TabIndex        =   2
         Top             =   240
         Width           =   975
      End
      Begin VB.Label Label11 
         Caption         =   "E-MAIL:"
         Height          =   255
         Left            =   0
         TabIndex        =   20
         Top             =   3240
         Width           =   615
      End
      Begin VB.Label Label10 
         Caption         =   "地址"
         Height          =   375
         Left            =   120
         TabIndex        =   18
         Top             =   2880
         Width           =   495
      End
      Begin VB.Label Label9 
         Caption         =   " 邮编"
         Height          =   255
         Left            =   1800
         TabIndex        =   16
         Top             =   2400
         Width           =   495
      End
      Begin VB.Label Label8 
         Caption         =   "电话"
         Height          =   255
         Left            =   120
         TabIndex        =   14
         Top             =   2520
         Width           =   495
      End
      Begin VB.Label dtpBirthday 
         Caption         =   "生日"
         Height          =   375
         Left            =   1920
         TabIndex        =   13
         Top             =   1920
         Width           =   495
      End
      Begin VB.Label Label6 
         Caption         =   "籍贯"
         Height          =   255
         Left            =   120
         TabIndex        =   11
         Top             =   2040
         Width           =   495
      End
      Begin VB.Label Label5 
         Caption         =   "班级"
         Height          =   255
         Left            =   1800
         TabIndex        =   9
         Top             =   1560
         Width           =   615
      End
      Begin VB.Label Label4 
         Caption         =   "性别"
         Height          =   375
         Left            =   120
         TabIndex        =   7
         Top             =   1560
         Width           =   495
      End
      Begin VB.Label Label3 
         Caption         =   "系别"
         Height          =   375
         Left            =   120
         TabIndex        =   5
         Top             =   1080
         Width           =   495
      End
      Begin VB.Label Label2 
         Caption         =   "姓名"
         Height          =   255
         Left            =   120
         TabIndex        =   3
         Top             =   720
         Width           =   615
      End
      Begin VB.Label Label1 
         Caption         =   "学号"
         Height          =   255
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   615
      End
   End
End
Attribute VB_Name = "FrmAddStudent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strCnn As String
Dim cnn As New Connection
Dim cmd As New ADODB.Command
Public strStuNo As String

Private Sub Form_load()
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=学生信息管理系统;Data Source=556337A19B704A1"
cnn.Open strCnn

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 Recordset
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "stu_AddBasicStudentInfo"
cmd.Parameters.Append cmd.CreateParameter("@studentNo", adChar, adParamInput, 6)
cmd.Parameters.Append cmd.CreateParameter("@name", adVarChar, adParamInput, 20)
cmd.Parameters.Append cmd.CreateParameter("@sex", adChar, adParamInput, 2)
cmd.Parameters.Append cmd.CreateParameter("@departName", adVarChar, adParamInput, 50)
cmd.Parameters.Append cmd.CreateParameter("@classname", adVarChar, adParamInput, 50)
cmd.Parameters.Append cmd.CreateParameter("@birthday", adDate, adParamInput)
cmd.Parameters.Append cmd.CreateParameter("@native", adVarChar, adParamInput, 50)
cmd.Parameters.Append cmd.CreateParameter("@phone", adVarChar, adParamInput, 20)
cmd.Parameters.Append cmd.CreateParameter("@address", adVarChar, adParamInput, 100)
cmd.Parameters.Append cmd.CreateParameter("@zipCode", adVarChar, adParamInput, 8)
cmd.Parameters.Append cmd.CreateParameter("@email", adVarChar, adParamInput, 50)
cmd.Parameters.Append cmd.CreateParameter("@memo", adVarChar, adParamInput, 1000)
cmd.Parameters.Refresh
cmd.Parameters(1).Value = txtID.Text
cmd.Parameters(2).Value = txtName.Text
cmd.Parameters(3).Value = cmbSex.Text
cmd.Parameters(4).Value = txtDepartment.Text
cmd.Parameters(5).Value = txtClass.Text
cmd.Parameters(6).Value = dtpBirthday1.Value
cmd.Parameters(7).Value = txtNative.Text
cmd.Parameters(8).Value = txtPhone.Text
cmd.Parameters(9).Value = txtAddress.Text
cmd.Parameters(10).Value = txtZipCode.Text
cmd.Parameters(11).Value = txtEmail.Text
cmd.Parameters(12).Value = txtMemo.Text
Set Rs.Source = cmd
Rs.Open
Set Rs = cmd.Execute()
Exit Sub
Errhandle:
  MsgBox Err.Description
End Sub

Private Sub reset()
txtID = " "
txtName.Text = " "
cmbSex.Text = "男"
txtDepartment = " "
txtClass.Text = " "
txtNative.Text = " "
txtPhone.Text = " "
txtAddress.Text = " "
txtZipCode.Text = " "
txtEmail.Text = " "
txtMemo.Text = " "
End Sub

Private Sub cmdOK_Click()
Append
reset
End Sub
Private Sub From_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
FrmAddStudent.PopupMenu mnuAdd, 0, X, Y
End If
End Sub

Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
FrmAddStudent.PopupMenu mnuAdd, 0, X, Y
End If
End Sub

Private Sub mnuChange_Click()
'MsgBox "当前记录学号为"
If Trim(txtID.Text) <> "  " Then
FrmAddChange.strStuNo = Trim(txtID.Text)
FrmAddChange.Show vbModal
End If
End Sub
Private Sub mnu_Punish_Click()
'MsgBox"当前记录学号为"
If Trim(txtID.Text) <> "  " Then
FrmAddPunish.strStuNo = Trim(txtID.Text)
FrmAddPunish.Show vbModal
End If

End Sub
Private Sub mnuReward_Click()
'MsgBox"当前记录学号为"
If Trim(txtID.Text) <> "  " Then
FrmAddReward.strStuNo = Trim(txtID.Text)
FrmAddReward.Show vbModal
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -