Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在制作一个人们需要登录的应用程序,这些数据位于 Oracle 10g XE DB 上,我知道如何访问数据,但我不知道如何验证查询是否返回某些内容(当然是验证用户名和密码)。我正在使用带有 VB.net 的 ODBC 来连接数据库。有什么帮助吗?谢谢。
You can use SELECT COUNT(*) which will always return some value:
SELECT COUNT(*)
SELECT COUNT(*) AS user_ok FROM my_app_users WHERE user_id='xxx' AND user_passwd=SHA256(user_salt || 'xyz')
In case user do not exists or 'xyz' is not a password you will get '0'.