我在Microsoft Access中有一个查询:
PARAMETERS Username Text, Password Text;
//Value entered for Username = 'a'
//Value entered for Password = 'a'
SELECT ID, Username, Password, FormalName
FROM tblUsers
WHERE (Username = @Username) AND (Password = @Password)
我希望这不会返回一行,因为没有这样的用户名'a'而且没有这样的密码'a'但它确实返回了一行:
答案 0 :(得分:1)
您在查询中使用SQL Server语法作为参数,我希望它看起来像这样:
SELECT ID, Username, Password, FormalName
FROM tblUsers
WHERE (Username = [Username]) AND (Password = [Password])