Private Sub Command1_Click()
Dim mpassword As String
Adodc1.RecordSource = "select * from employee where 用戶名 =' " & Text1.Text & " ' "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
mpassword = Adodc1.Recordset.Fields("員工密碼")
If Text2.Text = mpassword Then
Name1 = Text1.Text
Form2.Show
'frm_main.Show
Unload Me
Else
MsgBox "密碼不正確,請您確認后重新輸入", 53, "錯誤提示"
Text2.Text = ""
Text2.SetFocus
End If
Else
MsgBox "用戶名或密碼錯誤,請從新輸入!", 53, "提示資訊"
Text1.Text = ""
Text2.Text = ""
End If
End Sub
Private Sub Command2_Click()
End
End Sub
uj5u.com熱心網友回復:
系統提示 至少有一個值未指定,求教uj5u.com熱心網友回復:
代碼中有不應有的空格:Adodc1.RecordSource = "select * from employee where 用戶名 =' " & Text1.Text & " ' "
應該為:
Adodc1.RecordSource = "select * from employee where 用戶名 ='" & Text1.Text & "'"
uj5u.com熱心網友回復:
這是初學者最易犯的錯誤。
uj5u.com熱心網友回復:
貌似上述錯誤只會造成查詢不到記錄,不會引起“至少有一個值未指定”的錯誤。查一下,表名或欄位名是否正確。uj5u.com熱心網友回復:
1,檢查代碼中的表名、欄位名與資料庫中的表名、欄位名是否一致2,檢查adodc1控制元件是否連上資料庫
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/92455.html
