s_temp = "select * from user "
If Login.name2 <> "" Then
s_temp = s_temp & "where name = '" & Login.name2 & "' "
If Login.pass2 <> "" Then
s_temp = s_temp & "and password = '" & Login.pass2 & "'"
End If
Adodc1.RecordSource = s_temp
Adodc1.Refresh '报错的地方,---- 另--FROM 子句语法错误~~
If Adodc1.Recordset.EOF Then
MsgBox "用户名或密码错误!"
Else
.............
end if
If Login.name2 <> "" Then
s_temp = s_temp & "where name = '" & Login.name2 & "' "
If Login.pass2 <> "" Then
s_temp = s_temp & "and password = '" & Login.pass2 & "'"
End If
Adodc1.RecordSource = s_temp
Adodc1.Refresh '报错的地方,---- 另--FROM 子句语法错误~~
If Adodc1.Recordset.EOF Then
MsgBox "用户名或密码错误!"
Else
.............
end if
If Login.name2 <> "" Then
Adodc1.Recordset.open "select 密码字段 form where 名字字段 = '"& login.name2 &"'"
if adodc1.recordset.eof then
MsgBox "用户名不存在!"
else
if adodc1.recordset("密码字段") <> log.pass2
MsgBox "密码错误!"
end if
end if
end if
如果你这句代码是直接从你的语句上复制下来的话
那估计可能跟你在and前没有加空格有关,即修改成:
s_temp = s_temp & " and password = '" & Login.pass2 & "'"