请问个位大虾,这段程序是什莫意思,可否给单句注释

来源:百度知道 编辑:UC知道 时间:2024/05/30 18:53:34
Private Sub Image1_Click()
Dim mrc As ADODB.Recordset
txtsql = "select username from use where username='" & Trim(Text1.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
MsgBox " 用户名错误!", vbExclamation + vbOKOnly, "警告"
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Exit Sub
End If
username = mrc.Fields(0)
txtsql = "select username from use where password='" & Trim(Text2.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
MsgBox " 密码错误!", vbExclamation + vbOKOnly, "警告"
Text2.SetFocus
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
Exit Sub
End If
chaxun.Show
qidong.Hide
denglu.Hide
End Sub

Private Sub Image2_Click()
qidong.Show
denglu.Hide
End Sub

Private Sub image1_K

Private Sub Image1_Click() 在第一个图片上单击
Dim mrc As ADODB.Recordset 定义mrc变量数据库记录集
txtsql = "select username from use where username='" & Trim(Text1.Text) & "'" 查找数据库里有没有在text1.text输入的用户
Set mrc = ExecuteSQL(txtsql) 执行查询,并把结果返回给mrc
If mrc.EOF = True Then 如果mrc什么都没有,说明没有这个用户
MsgBox " 用户名错误!", vbExclamation + vbOKOnly, "警告" 显示信息
Text1.SetFocus 把光标定到text1里
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text) 这2句是选中text1中的字符.
Exit Sub 退出过程
End If
username = mrc.Fields(0) 将用户名放在变量username里
txtsql = "select username from use where password='" & Trim(Text2.Text) & "'" 同上,查找有没有密码跟text2里相同的用户
Set mrc = ExecuteSQL(txtsql) 同上
If mrc.EOF = True Then
MsgBox " 密码错误!", vbExclamation + vbOKOnly, "警告"
Text2.SetFocus
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
Exit Sub
End If
chaxun.Show