主要代码如下: 1、登录界面代码: Dim cn As New ADODB.Connection Dim rst As New ADODB.Recordset Private Sub Command1_Click() Set cn = New ADODB.Connection Set rst = New ADODB.Recordset 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) 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 管理界面.Show Else i = i + 1 If i < 3 Then MsgBox "用户名或密码错误!", vbOKOnly + vbExclamation, "警告" cn.Close Text2.Text = "" Text1.Text = "" Text1.SetFocus Else MsgBox " 该用户已被锁定!", vbOKOnly + vbExclamation, " 警告" End If End If End If End Sub Private Sub Command2_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub 2、管理界面代码: Private Sub Sinsert_Click() 添加学生信息.Show End Sub 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() 用户注册.Show End Sub 3、查询学生信息代码: Dim cn As New ADODB.Connection Dim rst As New ADODB.Recordset Private Sub Command1_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 Combo1.Text <> "" Then mysql = "select * from 学生信息表 where 系别='" & Trim(Combo1.Text) & "'" rst.Open mysql, cn If rst.EOF Then MsgBox "没有学生!", vbOKOnly + vbExclamation, "警告" Combo1.Text = "" Else With MSFlexGrid1 .TextMatrix(0, 1) = "学号...