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

📄 zysz.frm

📁 学生管理系统 很不错的一个课程设计 适合大学生毕业设计用
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form 专业设置 
   Caption         =   "院系、专业设置-专业设置"
   ClientHeight    =   5025
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5895
   LinkTopic       =   "Form22"
   ScaleHeight     =   5025
   ScaleWidth      =   5895
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame3 
      Caption         =   "专业浏览"
      Height          =   3045
      Left            =   0
      TabIndex        =   8
      Top             =   1980
      Width           =   5865
      Begin MSFlexGridLib.MSFlexGrid MSF1 
         Height          =   2805
         Left            =   60
         TabIndex        =   9
         Top             =   210
         Width           =   5805
         _ExtentX        =   10239
         _ExtentY        =   4948
         _Version        =   393216
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "专业设置"
      Height          =   1455
      Left            =   0
      TabIndex        =   1
      Top             =   510
      Width           =   5865
      Begin VB.CommandButton Command1 
         Caption         =   "添加"
         Height          =   285
         Left            =   390
         TabIndex        =   14
         Top             =   1050
         Width           =   645
      End
      Begin VB.CommandButton Command5 
         Caption         =   "取消"
         Height          =   285
         Left            =   4830
         TabIndex        =   13
         Top             =   1050
         Width           =   675
      End
      Begin VB.CommandButton Command4 
         Caption         =   "确定"
         Height          =   285
         Left            =   3690
         TabIndex        =   12
         Top             =   1050
         Width           =   735
      End
      Begin VB.CommandButton Command3 
         Caption         =   "修改"
         Height          =   285
         Left            =   2534
         TabIndex        =   11
         Top             =   1050
         Width           =   735
      End
      Begin VB.CommandButton Command2 
         Caption         =   "删除"
         Height          =   285
         Left            =   1432
         TabIndex        =   10
         Top             =   1050
         Width           =   705
      End
      Begin VB.Frame Frame2 
         Caption         =   "专业代码"
         Height          =   735
         Left            =   3750
         TabIndex        =   6
         Top             =   210
         Width           =   1905
         Begin VB.TextBox Text2 
            Height          =   315
            Left            =   120
            TabIndex        =   7
            Top             =   300
            Width           =   1665
         End
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   990
         Style           =   2  'Dropdown List
         TabIndex        =   4
         Top             =   210
         Width           =   2355
      End
      Begin VB.TextBox Text1 
         Height          =   285
         Left            =   990
         TabIndex        =   3
         Top             =   660
         Width           =   2325
      End
      Begin VB.Label Label3 
         Caption         =   "专业名称"
         Height          =   225
         Left            =   210
         TabIndex        =   5
         Top             =   690
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "院系"
         Height          =   225
         Left            =   210
         TabIndex        =   2
         Top             =   240
         Width           =   525
      End
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "专 业 设 置"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   60
      TabIndex        =   0
      Top             =   60
      Width           =   5775
   End
End
Attribute VB_Name = "专业设置"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim zt As String
Dim yxdm As String
Dim yxdma As String
Dim zydm As String
Dim mrc As ADODB.Recordset
Public Sub kscom()
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = False
Command5.Enabled = True
End Sub
Public Sub zyshowtitle()
 MSF1.Clear
  Dim i As Integer
  With MSF1
    .Cols = 4
    .TextMatrix(0, 1) = "专业代码"
    .TextMatrix(0, 2) = "专业名称"
    .TextMatrix(0, 3) = "院系代码"
    .ColWidth(0) = 0
    .ColWidth(1) = 400
    .ColWidth(2) = 1500
    .ColWidth(3) = 1500
    .FixedRows = 1
    
    .FillStyle = flexFillSingle
    .Col = 0
    .Row = 0
    .RowSel = 1
    .ColSel = .Cols - 1
    .CellAlignment = 4
    .Row = 1
    End With
End Sub

Private Sub Command4_Click()
'******************************************
'专业添加代码
'*****************************************
If zt = "cmd1add" Then
If Combo1.Text = "" Then
     sssss = MsgBox("院系名称不能为空!", vbOKOnly + vbExclamation, "警告")
     'Text1.SetFocus
     Exit Sub
  End If
  txtsql = "select * from 院系 where 院系名称='" & Trim(Combo1.Text) & "'"
  Set mrc = ExecuteSQL(txtsql)
  yxdm = mrc.Fields(0)
  mrc.Close
If Text2.Text = "" Then
     sssss = MsgBox("专业代码不能为空!", vbOKOnly + vbExclamation, "警告")
     Text1.SetFocus
     Exit Sub
  End If
    If Text1.Text = "" Then
     sssss = MsgBox("专业名称不能为空!", vbOKOnly + vbExclamation, "警告")
     Text2.SetFocus
     Exit Sub
  End If
txtsql = "select * from 专业 where 专业代码='" & Trim(Text2.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
 ' mrc.Refresh
  If mrc.EOF = False Then
   sssss = MsgBox("已经存在该专业代码!", vbOKOnly + vbExclamation, "警告")
    Text2.SetFocus
     Text2.SelStart = 0
     Text2.SelLength = Len(Text2.Text)
    Exit Sub
   Else
  mrc.AddNew
  mrc.Fields(0) = Text2.Text
  mrc.Fields(1) = Text1.Text
  mrc.Fields(2) = Trim(yxdm)
  mrc.Update
  MsgBox "专业添加成功!", vbOKOnly + vbExclamation, "警告"
 Text1.Text = ""
 Text2.Text = ""
  
 zyshowtitle
 zyshowdata
 
 End If
 End If
 '********************************************************
 '专业修改代码
 '********************************************************
 If zt = "cmd3edit" Then
 txtsql = "select * from 专业 where 专业代码='" & Trim(Text2.Text) & "'"
 Set mrc = ExecuteSQL(txtsql)
 If mrc.Fields(1) = Trim(Text1.Text) Then
 MsgBox "必须输入改变值!", vbOKOnly + vbExclamation, "警告"
 Text1.SetFocus
 Exit Sub
 Else
 mrc.Fields(0) = Text2.Text
  mrc.Fields(1) = Text1.Text
  mrc.Update
  MsgBox "专业修改成功!", vbOKOnly + vbExclamation, "提示"
 Text1.Text = ""
 Text2.Text = ""
  
 zyshowtitle
 zyshowdata
 End If
 End If
 zt = "0"
 Text1.Enabled = False
Text2.Enabled = False
Me.kscom
Text1.Text = ""
Text2.Text = ""
Me.zyshowtitle
Me.zyshowdata
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub Command1_Click()
zt = "cmd1add"
Text2.Enabled = True
Text1.Enabled = True
'Combo1.Enabled = True
  Text1.Text = ""
  Text2.Text = ""
  Command2.Enabled = False
  Command3.Enabled = False
  Command4.Enabled = True
 End Sub

Private Sub Command2_Click()
'zt = "cmd2del"
If Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) = "" Then
   sssss = MsgBox("你还没有选择记录!", vbOKOnly + vbExclamation, "警告")
Else
  If MsgBox("确定要删除 专业名称 为 " & Trim(Me.MSF1.TextMatrix(MSF1.Row, 2)) & " 的记录吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
  txtsql = "select * from 专业 where 专业代码='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
  Set mrc = ExecuteSQL(txtsql)
  zydm = Trim(Me.MSF1.TextMatrix(MSF1.Row, 1))
  'mrc.Refresh
  mrc.Delete
  mrc.Close
   '删除学生基本信息表中的该专业代码的院系
  txtsql = "select * from 学生基本信息 where 专业代码='" & Trim(zydm) & "'"
  Set mrc = ExecuteSQL(txtsql)
  If Not mrc.EOF Then
  mrc.Delete
  End If
  mrc.Close
  '删除班级表中的属于该专业的记录
   txtsql = "select * from 班级 where 专业代码='" & Trim(zydm) & "'"
  Set mrc = ExecuteSQL(txtsql)
  If Not mrc.EOF Then
  mrc.Delete
  End If
  mrc.Close
  '************************************
  MsgBox "专业删除成功!", vbOKOnly + vbExclamation, "提示"
  Text1.Text = ""
   Text2.Text = ""
  zyshowtitle
  zyshowdata
  End If
End If
End Sub

Private Sub Command3_Click()
zt = "cmd3edit"
If Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) = "" Then
   sssss = MsgBox("你还没有选择记录!", vbOKOnly + vbExclamation, "警告")
   Command2.Enabled = True
   Command1.Enabled = True
   'Text1.Enabled = False
   Text2.Enabled = False
   Command3.Enabled = True
Else

   Text1.Enabled = True
   Text2.Enabled = False
   Text1.SetFocus
   Command2.Enabled = False
   Command1.Enabled = False
   Command4.Enabled = True
   Command3.Enabled = False
End If
End Sub

Private Sub Form_Load()
txtsql = "select * from 院系"
Set mrc = ExecuteSQL(txtsql)
Do While Not mrc.EOF
Combo1.AddItem mrc.Fields(1)
mrc.MoveNext
Loop
mrc.Close
Text1.Enabled = False
Text2.Enabled = False
Me.kscom
'adodc1.ConnectionString = connstring
Text1.Text = ""
Text2.Text = ""
'txtsql = "select * from 院系"
Me.zyshowtitle
Me.zyshowdata

End Sub

Public Sub zyshowdata()
Dim j As Integer
Dim i As Integer

'Dim mrc As adodb.Recordset
txtsql = "select * from 专业"
Set mrc = ExecuteSQL(txtsql)
'mrc.Refresh
 If mrc.EOF = False Then
   mrc.MoveFirst
   With MSF1
   .Rows = 15
     .Row = 2
   
    Do While Not mrc.EOF
     .Rows = .Rows + 1
     For i = 1 To mrc.Fields.Count
      .TextMatrix(.Row - 1, i) = mrc.Fields(i - 1)
     Next i
     .Row = .Row + 1
     mrc.MoveNext
    Loop
 End With
End If
End Sub

Private Sub MSF1_Click()
'Dim mrc As adodb.Recordset
If Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) = "" Then
   Text1.Text = ""
   Text2.Text = ""
Else
  txtsql = "select * from 专业 where 专业代码='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
  Set mrc = ExecuteSQL(txtsql)
  'mrc.Refresh
   Text2.Text = mrc.Fields(0)
   Text1.Text = mrc.Fields(1)
   yxdma = mrc.Fields(2)
   mrc.Close
   'txtsql = "select * from  院系 where 院系代码='" & Trim(yxdma) & "'"
  'Set mrc = ExecuteSQL(txtsql)
  'Combo1.ZOrder mrc.Fields(0)
  'mrc.Close
End If
Me.kscom
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  Text2.SetFocus
End If
End Sub



⌨️ 快捷键说明

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