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

📄 frmstudelect.frm

📁 一个用VB+SQL+SERVER+2000写的学生信息管理系统.rar
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmstudelect 
   Caption         =   "frmstudelect"
   ClientHeight    =   6915
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7425
   LinkTopic       =   "Form1"
   Picture         =   "frmstudelect.frx":0000
   ScaleHeight     =   6915
   ScaleWidth      =   7425
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   1200
      TabIndex        =   15
      Top             =   5880
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   4920
      TabIndex        =   14
      Top             =   5880
      Width           =   1335
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Index           =   1
      ItemData        =   "frmstudelect.frx":9E62
      Left            =   2880
      List            =   "frmstudelect.frx":9E75
      TabIndex        =   6
      Top             =   5160
      Width           =   2775
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Index           =   0
      ItemData        =   "frmstudelect.frx":9EA5
      Left            =   2880
      List            =   "frmstudelect.frx":9EB8
      TabIndex        =   5
      Top             =   4440
      Width           =   2775
   End
   Begin VB.OptionButton Option2 
      Caption         =   "女"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4200
      TabIndex        =   4
      Top             =   3600
      Width           =   735
   End
   Begin VB.OptionButton Option1 
      Caption         =   "男"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Index           =   1
      Left            =   2880
      TabIndex        =   3
      Top             =   3600
      Width           =   735
   End
   Begin VB.TextBox sno 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Index           =   2
      Left            =   2760
      TabIndex        =   2
      Top             =   2400
      Width           =   2415
   End
   Begin VB.TextBox sno 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Index           =   1
      Left            =   2760
      TabIndex        =   1
      Top             =   1560
      Width           =   2415
   End
   Begin VB.TextBox sno 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Index           =   0
      Left            =   2760
      TabIndex        =   0
      Top             =   720
      Width           =   2415
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "学 籍 信 息 修 改"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   21.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Index           =   0
      Left            =   1440
      TabIndex        =   13
      Top             =   0
      Width           =   4095
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "班别:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Index           =   2
      Left            =   1680
      TabIndex        =   12
      Top             =   5160
      Width           =   750
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "所在系:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Index           =   1
      Left            =   1680
      TabIndex        =   11
      Top             =   4440
      Width           =   1050
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "性 别:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Index           =   0
      Left            =   1680
      TabIndex        =   10
      Top             =   3600
      Width           =   900
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "年 龄:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   1680
      TabIndex        =   9
      Top             =   2520
      Width           =   900
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "姓 名:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   1680
      TabIndex        =   8
      Top             =   1680
      Width           =   900
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "学 号:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Index           =   1
      Left            =   1680
      TabIndex        =   7
      Top             =   840
      Width           =   900
   End
End
Attribute VB_Name = "frmstudelect"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()

Dim txtsql As String

Dim myConn As New ADODB.Connection

mySQL = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;"
mySQL = mySQL + "Initial Catalog=学生信息管理系统;"


myConn.ConnectionString = mySQL
myConn.Open


Dim aa As Integer
 txtsql = ""
Dim txtsql1 As String
txtsql1 = ""
If Trim(sno(0).Text) <> "" Then
  aa = 1
End If
  If aa = 1 Then
   txtsql1 = txtsql1 & " where 学生学号=" & Trim(sno(0).Text)
  Else
    pp = MsgBox("学生学号不能为空!", , " 警告")
    Exit Sub
  End If

If Trim(sno(1).Text) <> "" Then
aa = 1
  If txtsql = "" Then
    txtsql = "set student.学生姓名='" & Trim(sno(1).Text) & "'"
  Else
    txtsql = txtsql & ",student.学生姓名='" & Trim(sno(1).Text) & "'"
  End If
End If
If Trim(sno(2).Text) <> "" Then
  aa = 1
  If txtsql = "" Then
    txtsql = "set student.年龄='" & Trim(sno(2).Text) & "'"
  Else
    txtsql = txtsql & ",student.年龄='" & Trim(sno(2).Text) & "'"
  End If
End If
If Trim(Combo1(0).Text) <> "" Then
  aa = 1
  If txtsql = "" Then
    txtsql = "set student.所在系='" & Trim(Combo1(0).Text) & "'"
  Else
    txtsql = txtsql & ",student.所在系='" & Trim(Combo1(0).Text) & "'"
  End If
End If
If Trim(Combo1(1).Text) <> "" Then
  aa = 1
  If txtsql = "" Then
    txtsql = "set student.班级='" & Trim(Combo1(1).Text) & "'"
  Else
    txtsql = txtsql & ",student.班级='" & Trim(Combo1(1).Text) & "'"
  End If
End If
If Option1(1).Value <> False Then
  aa = 1
  If txtsql = "" Then
    txtsql = "set student.性别='男'"
  Else
    txtsql = txtsql & ",student.性别='男'"
  End If
End If
If Option2.Value <> False Then
  aa = 1
  If txtsql = "" Then
    txtsql = "set student.性别='女'"
  Else
    txtsql = txtsql & ",student.性别='女'"
  End If
End If


Dim str1 As String
str1 = "select * from student " & txtsql1

Dim mrc As ADODB.Recordset
Set mrc = myConn.Execute(str1)

If mrc.EOF = True Then
 zzz = MsgBox("对不起,没有此学生的档案记录!")
 Exit Sub
 End If
 
 
Dim str As String
str = "update student " & txtsql & txtsql1
MsgBox ("修改成功!")
'Dim mrc As ADODB.Recordset'
Set mrc = myConn.Execute(str)


   Exit Sub


Find = True
'select xj.学号,xj.姓名,xj.性别,class.年级,xj.班级,class.专业,class.年制,xj.出生年月,xj.家庭住址,xj.邮政编码,xj.联系电话,xj.入学时间,xj.备注 from xj inner join class on xj.班级=class.班级  where xj.班级='01美术一' or 年级='01美术一' order by class.年级 desc,class.班级 desc,xj.学号 desc
' Student_search.showtitle '
'Student_search.showdata'

End Sub


⌨️ 快捷键说明

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