dim conn As New ADODB.Connection
dim rst As New ADODB.Recordset
dim sql As String, cn As String
If id.Text = "" Or pwd.Text = "" Then
MsgBox "不能为空",vbInformation, "不能空"
Exit Sub
Else
If rst.State Then rst.Close
sql = "select id,pwd from mispaymentsyle where pwd='" & Trim(pwd.Text) & "'"
rst.Open sql, conn, adOpenKeyset, adLockPessimistic
If rst.EOF = True Then
MsgBox "密码错",vbInformation, "错误. . ."
end if
'ID比较就把字段pwd换成id就可以了.比较对象用id.text