学生信息管理系统代码

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Private Sub Sselect_Click()查询学生信息.Show
End Sub
Private Sub sustu_Click()查询更新学生信息.Show
End Sub
Private Sub xgmm_Click()
修改密码.Show
End Sub
Private Sub yhzc_Click()
主要代码如下:
1、登录界面代码:
Dim cn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Private Sub mand1_Click()
Set cn=New ADODB.Connection
Set rst=New ADODB.Recordset
年龄"
.TextMatrix(0,5) = "
系别"
.TextMatrix(0,6) = "
班级"
Do While ห้องสมุดไป่ตู้ot rst.EOF
.Rows=.Rows+ 1.CellAlignment= 8
.TextMatrix(.Rows- 1, 1) =rst.Fields("学号")
.TextMatrix(.Rows- 1, 2) =rst.Fields("姓名")
管理界面.Show
Else
i=i+ 1
If i< 3Then
MsgBox"用户名或密码错误!",vbOKOnly+vbExclamation,"
做小II
警告"
cn.Close
Text2.Text= ""
Text1.Text= ""
Text1.SetFocus
Else
MsgBox"该用户已被锁定!",vbOKOnly+vbExclamation,"告"
用户注册.Show
End Sub
3、查询学生信息代码:
Dim cn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Private Sub mand1_Click()
Set cn=New ADODB.Connection
Set rst=New ADODB.Recordset
cn.ConnectionString="Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Initial Catalog=students info;Data Source=C1847"
cn.Open
If bo1.Text<> ""Then
mysql="select*from用户表where用户名='" &usna& "'"
rst.Open mysql, cn
If rst.EOF Then
MsgBox"用户名不存在!"
cn.Close
Text1.Text= ""
Text2.Text= ""
Text1.SetFocus
Else
If Trim(rst("密码")) =Trim(Text2.Text) Then
End If
ElseIf Text1.Text<> ""Then
mysql="select*from学生信息表where学号='" &
Trim(Text1.Text)& "'"
学号")
.TextMatrix(.Rows- 1, 2) =rst.Fields(
姓名")
.TextMatrix(.Rows- 1, 3) =rst.Fields(
性别")
.TextMatrix(.Rows- 1, 4) =rst.Fields(
年龄")
.TextMatrix(.Rows- 1, 5) =rst.Fields(
系别")
.TextMatrix(.Rows- 1, 6) =rst.Fields(
班级")
rst.MoveNext
Loop
End With
End If
ElseIf bo2.Text<> ""Then
mysql="select*from学生信息表where班级='" &
Trim(bo2.Text)& "'"
性别"
.TextMatrix(0,4) = "
年龄"
.TextMatrix(0,5) = "
系别"
.TextMatrix(0,6) = "
班级"
Do While Not rst.EOF .Rows=.Rows+ 1
.CellAlignment= 8
.TextMatrix(.Rows- 1, 1) =rst.Fields(
End If
End If
End If
End Sub
Private Sub mand2_Click()
Text1.Text= ""
Text2.Text= ""
Text3.Text= ""
End Sub
2、管理界面代码:
Private Sub Sinsert_Click()
添加学生信息.Show
End Sub
rst.Open mysql, cn
If rst.EOF Then
bo1.Text= ""
Else
With MSFlexGrid1
.TextMatrix(0,1) = "
学号"
.TextMatrix(0,2) = "
姓名"
.TextMatrix(0,3) = "
性别"
.TextMatrix(0,4) = "
Static i%
cn.ConnectionString="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=students info;Data Source=C1847"
cn.Open
usna=Trim(Text1.Text)
.TextMatrix(.Rows- 1, 3) =rst.Fields("性别")
.TextMatrix(.Rows- 1, 4) =rst.Fields("年龄")
.TextMatrix(.Rows- 1, 6) =rst.Fields("班级")
rst.MoveNext
Loop
End With
Trim(bo1.Text)& "'"
rst.Open mysql, cn
If rst.EOF Then
bo1.Text= ""
Else
With MSFlexGrid1
.TextMatrix(0,1) = "
学号"
.TextMatrix(0,2) = "
姓名"
.TextMatrix(0,3) = "
相关文档
最新文档