|
做好了窗体,写好了代码。但无法登录,不管输入什么都出现类似下图所示提示!~!~
另附可能出现代码错误的代码:
Private Sub cmdOK_Click()
'检查正确的密码
sirname = Trim$(Cbl_name.Text)
sirpwd = UCase$(Trim$(txtpassword))
sSQL = "select*from密码表 where usname='" & sirname & "'" & "and passwd='" & sirpwd & "'"
Data1.RecordSource = sSQL
Data1.Refresh
If Data1.Recordset.RecordCount > 0 Then
Unload Me
Unload frmstart
frmMain.Show
Else
MsgBox "无效的密码,请重试!", , "登录"
txtpassword.SetFocus
txtpassword = ""
End If
End Sub
望高手指教!~!~1 |
|