Private Sub cmdenter_Click() '登录
Dim str_rs As String
str_rs = "select * from 用户表 where user1='" & txtusername.Text & "'"
rs.Open str_rs, cn
If rs.EOF Then
MsgBox "没有这个用户,请先去注册!"
End If
If rs.Fields("pwd") = "& txtpassword &" Then
MsgBox "登录成功!"
Else
MsgBox "对不起,你输入的密码不正确,请重新输入!"
txtpassword.Text = ""
End If
End Sub
Dim str_cn As String
str_cn = "driver=sql server;server=(local);database=student"
cn.Open str_cn
为什么我的登录总是出现密码错误,新手初来,大哥大姐帮帮!