我在登陆页面里用Tquery控件时,用sql语句:
sql.add('select username,password from table where username=:user and password=:pass');
问题是我怎样得到select语句的返回值,应该有一个boolean类型的值以判断是否查询成功
if boolean=1 then
showmessage('登陆成功’)
esle showmessage(‘用户名或密码出错,请核对后从新登陆’);
在Ttable控件里有一个gotokey,
if gotokey then ...
但是在Tquery里面呢?各位大侠如果有好的登陆方面的代码请贴出来,谢谢大家:)
sql.add('select username,password from table where username=:user and password=:pass');
问题是我怎样得到select语句的返回值,应该有一个boolean类型的值以判断是否查询成功
if boolean=1 then
showmessage('登陆成功’)
esle showmessage(‘用户名或密码出错,请核对后从新登陆’);
在Ttable控件里有一个gotokey,
if gotokey then ...
但是在Tquery里面呢?各位大侠如果有好的登陆方面的代码请贴出来,谢谢大家:)
解决方案 »
- 呵呵,升星星了,散分
- Copy两个DataSet,难死所有高手!
- 最近www.delphibbs.com登录不上去 ,是不是换地址了啊!望知道的同志告诉一下,谢谢了,,
- adoquery动态识别数据库名
- delphi如何调用windows内部网络命令啊,比如net share test=c:\test这个命令,具体语法是怎么的啊?
- DLL创建的窗口融入Panel控件内?要求实例源代码....
- delphi访问access数据库
- 超级复杂的数据库问题
- 急救!!(有分)
- 查询!!关于时间字段(取最大值)与当前时间比较!(Select Max(DTPay) from labor where Max(DTPay)>=''''!!)
- 求助:关于写dll文件的问题
- 关于将数据从文本文件导入到access2000的问题。
query1.sql.text:='select username,password from table where username=:user and password=:pass';
Query1.open;
if not Query1.IsEmpty thenShowmessage('此人是合法用户')
else
ShowmMessage('此人是非法用户');
query1.sql.text:='select username,password from table where username=:user and password=:pass';
Query1.Params[0].Value:=edtUser.Text;
Query1.params[1].Value:=edtPass.Text;
Query1.open;
if Query1.IsEmpty thenShowmMessage('此人是非法用户')else
Showmessage('此人是合法用户');