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

📄 tianjiaxueshengxinxi.frm

📁 VB+access 的桌面型应用系统 学校应用其管理毕业论文
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Tianjiaxueshengxinxi 
   Caption         =   "Form1"
   ClientHeight    =   6555
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   9525
   LinkTopic       =   "Form1"
   ScaleHeight     =   6555
   ScaleWidth      =   9525
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdClose 
      Caption         =   "退出"
      Height          =   855
      Left            =   4440
      TabIndex        =   20
      Top             =   5040
      Width           =   1455
   End
   Begin VB.CommandButton cmdReset 
      Caption         =   "取消重填"
      Height          =   735
      Left            =   2640
      TabIndex        =   19
      Top             =   5040
      Width           =   1335
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "添加"
      Height          =   735
      Left            =   720
      TabIndex        =   18
      Top             =   5040
      Width           =   1215
   End
   Begin VB.TextBox Text 
      Height          =   615
      Index           =   8
      Left            =   5400
      TabIndex        =   17
      Top             =   2640
      Width           =   2175
   End
   Begin VB.TextBox Text 
      Height          =   615
      Index           =   7
      Left            =   5400
      TabIndex        =   16
      Top             =   1680
      Width           =   2175
   End
   Begin VB.TextBox Text 
      Height          =   615
      Index           =   6
      Left            =   5400
      TabIndex        =   15
      Top             =   840
      Width           =   2175
   End
   Begin VB.TextBox Text 
      Height          =   615
      Index           =   5
      Left            =   5400
      TabIndex        =   14
      Top             =   120
      Width           =   2175
   End
   Begin VB.TextBox Text 
      Height          =   735
      Index           =   4
      Left            =   960
      TabIndex        =   13
      Top             =   3840
      Width           =   1695
   End
   Begin VB.TextBox Text 
      Height          =   615
      Index           =   3
      Left            =   960
      TabIndex        =   12
      Top             =   3000
      Width           =   1695
   End
   Begin VB.TextBox Text 
      Height          =   615
      Index           =   2
      Left            =   960
      TabIndex        =   11
      Top             =   2040
      Width           =   1695
   End
   Begin VB.TextBox Text 
      Height          =   615
      Index           =   1
      Left            =   960
      TabIndex        =   10
      Top             =   960
      Width           =   1695
   End
   Begin VB.TextBox Text 
      Height          =   495
      Index           =   0
      Left            =   960
      TabIndex        =   9
      Top             =   120
      Width           =   1695
   End
   Begin VB.Label Label9 
      Caption         =   "指导老师"
      Height          =   615
      Left            =   4440
      TabIndex        =   8
      Top             =   2760
      Width           =   1455
   End
   Begin VB.Label Label8 
      Caption         =   "论文题目"
      Height          =   615
      Left            =   4440
      TabIndex        =   7
      Top             =   1800
      Width           =   1215
   End
   Begin VB.Label Label7 
      Caption         =   "e-mail"
      Height          =   615
      Left            =   4560
      TabIndex        =   6
      Top             =   840
      Width           =   975
   End
   Begin VB.Label Label6 
      Caption         =   "QQ"
      Height          =   495
      Left            =   4560
      TabIndex        =   5
      Top             =   120
      Width           =   1215
   End
   Begin VB.Label Label5 
      Caption         =   "电话"
      Height          =   375
      Left            =   240
      TabIndex        =   4
      Top             =   3960
      Width           =   1335
   End
   Begin VB.Label Label4 
      Caption         =   "姓名"
      Height          =   375
      Left            =   240
      TabIndex        =   3
      Top             =   3120
      Width           =   1335
   End
   Begin VB.Label Label3 
      Caption         =   "专业"
      Height          =   495
      Left            =   240
      TabIndex        =   2
      Top             =   2160
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "学院"
      Height          =   375
      Left            =   240
      TabIndex        =   1
      Top             =   1080
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "学号"
      Height          =   495
      Left            =   360
      TabIndex        =   0
      Top             =   240
      Width           =   855
   End
End
Attribute VB_Name = "Tianjiaxueshengxinxi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs_user As New ADODB.Recordset
Dim rs_Xueyuan As New ADODB.Recordset
Private Sub cmdAdd_Click()
 If Text(0).Text = "" Then
      MsgBox "请输入学号!", vbOKOnly + vbInformation, "注意"
      Text(0).SetFocus
      Exit Sub
   ElseIf Text(1).Text = "" Then
      MsgBox "请输入学院名称!", vbOKOnly + vbInformation, "注意"
      Text(1).SetFocus
      Exit Sub
   ElseIf Text(2).Text = "" Then
      MsgBox "请输入专业名称!", vbOKOnly + vbInformation, "注意"
      Text(2).SetFocus
      Exit Sub
   ElseIf Text(3).Text = "" Then
      MsgBox "请输入姓名!", vbOKOnly + vbInformation, "注意"
      Text(3).SetFocus
      Exit Sub
   ElseIf Text(4).Text = "" Then
      MsgBox "请输入电话!", vbOKOnly + vbInformation, "注意"
      Text(4).SetFocus
      Exit Sub
   ElseIf Text(5).Text = "" Then
      MsgBox "请输入QQ!", vbOKOnly + vbInformation, "注意"
      Text(5).SetFocus
      Exit Sub
   ElseIf Text(6).Text = "" Then
      MsgBox "请输入e-mail!", vbOKOnly + vbInformation, "注意"
      Text(6).SetFocus
      Exit Sub
   ElseIf Text(7).Text = "" Then
      MsgBox "请输入论文题目!", vbOKOnly + vbInformation, "注意"
      Text(7).SetFocus
      Exit Sub
   ElseIf Text(8).Text = "" Then
      MsgBox "请输入指导老师姓名!", vbOKOnly + vbInformation, "注意"
      Text(8).SetFocus
      Exit Sub
   
   End If
   Dim sqluser As String
    '构造查询该用户名和密码的sql语句
    sqluser = "select * from 学生基本信息表 where 学号 = '" & Text(0).Text _
    & "'"
    rs_user.CursorLocation = adUseClient
    '打开数据游标
    rs_user.Open sqluser, conn, adOpenKeyset, adLockPessimistic
    If Not rs_user.EOF = True Then
       MsgBox "该学号已经存在,请重新输入!", vbOKOnly + vbInformation, "注意"
       rs_user.Close
       Exit Sub
    End If
    rs_user.Close
rs_Xueyuan.AddNew
rs_Xueyuan.Fields(0) = Text(0).Text
rs_Xueyuan.Fields(1) = Text(1).Text
rs_Xueyuan.Fields(2) = Text(2).Text
rs_Xueyuan.Fields(3) = Text(3).Text
rs_Xueyuan.Fields(4) = Text(4).Text
rs_Xueyuan.Fields(5) = Text(5).Text
rs_Xueyuan.Fields(6) = Text(6).Text
rs_Xueyuan.Fields(7) = Text(7).Text
rs_Xueyuan.Fields(8) = Text(8).Text
rs_Xueyuan.Update


   
MsgBox "添加学生信息成功!", vbOKOnly + vbExclamation, "注意"

For i = 0 To 8
      Text(i).Text = ""
   Next i
End Sub

Private Sub cmdClose_Click()
Unload Me
End Sub

Private Sub cmdReset_Click()
For i = 0 To 8
      Text(i).Text = ""
   Next i
End Sub

Private Sub Form_Load()
 Dim X0 As Long
   Dim Y0 As Long
   '让窗体居中
   X0 = Screen.Width
   Y0 = Screen.Height
   X0 = (X0 - Me.Width) / 2
   Y0 = (Y0 - Me.Height) / 2
   Me.Move X0, Y0
   Dim sqladd As String
   sqladd = "select * from 学生基本信息表 "
   rs_Xueyuan.CursorLocation = adUseClient
   rs_Xueyuan.Open sqladd, conn, adOpenKeyset, adLockPessimistic
End Sub

Private Sub Form_Unload(Cancel As Integer)
rs_Xueyuan.Close
End Sub


⌨️ 快捷键说明

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