小第我做了一个密码登录,想把登录不成功的次数放入数据库中,下次该用户登录时就知有非法用户在猜密码。但怎么都update不进去,望各位指教!
Dim rsUser As New ADODB.Recordset
If conn.State = 1 Then
rsUser.Open " select * from tpass where Name='" & Combo1.Text & "'", conn, adOpenStatic, adLockBatchOptimistic
If rsUser.State = 1 Then
If rsUser.RecordCount > 0 Then
If rsUser.Fields("PassWord").Value = Text1.Text Then
MsgBox "密码正确,欢迎使用", vbOKOnly + vbInformation, "登录成功"
Unload Me
fmain.Show
fmain.Enabled = True
Else
MsgBox "密码错误,请重输", vbOKOnly + vbInformation, "登录失败"
passcheck = passcheck + 1
'此处就是update的地方
rsUser!passid = passcheck
rsUser.Update
End If
End If
End If
End If
Dim rsUser As New ADODB.Recordset
If conn.State = 1 Then
rsUser.Open " select * from tpass where Name='" & Combo1.Text & "'", conn, adOpenStatic, adLockBatchOptimistic
If rsUser.State = 1 Then
If rsUser.RecordCount > 0 Then
If rsUser.Fields("PassWord").Value = Text1.Text Then
MsgBox "密码正确,欢迎使用", vbOKOnly + vbInformation, "登录成功"
Unload Me
fmain.Show
fmain.Enabled = True
Else
MsgBox "密码错误,请重输", vbOKOnly + vbInformation, "登录失败"
passcheck = passcheck + 1
'此处就是update的地方
rsUser!passid = passcheck
rsUser.Update
End If
End If
End If
End If
加个判断
if存在 then
该用户passcheck + 1
else
新建该用户 1
endif
加个判断
if存在 then
该用户passcheck + 1
else
新建该用户 1
endif
rsUser.Open " select * from tpass where Name='" & Combo1.Text & "'", conn, adOpenStatic, adLockOptimistic
select * from user where username='"& combo1.text &"'
打开数据库....
哎 也就是 qingming81所写的.....