解决方案 »
- 字符串数组问题
- 在TImage中绘图时,如何捕获按键信息?
- ttable不 能设置active属性
- 这是怎么回事?
- UDP服务器端数据不能接收
- 求Delphi5或者6的下载地址
- 怎么使用计算字段啊?
- 如何解除Kylix3的三十天限制
- 深度问题:并发时对同一数据对象的操作造成数据瓶颈,有过多用户并发系统开发经验的高手请进
- 在关闭我程序时候总提示:内存不能读,很讨厌,能不能用try给过滤了?
- 散分,不记得多久没来过了,发布一个自己写的软件,H264/AAC录制视音频,保存FLV,支持RTMP直播,delphi写的主程序,这么多年了还是喜欢delphi
- delphi 用 dbexpress 连接到数据库,如何增加记录呢?
程序代码是这样的 请高手帮我看看问题出在什么地方
procedure TForm1.Button1Click(Sender: TObject);
begin
try
with adoquery1 do
begin
close;
sql.clear;
sql.add('select * from 管理 where 用户名=:a and 密码=:b ');
parameters.ParamByName('a').Value:=trim(combobox1.Text);
parameters.ParamByName('b').Value:=trim(edit1.Text);
if combobox1.Text ='' then
begin
application.MessageBox('请输入用户名','提示信息',64);
combobox1.SetFocus;
exit;
end;
if edit1.Text ='' then
begin
application.MessageBox('请输入密码','提示信息',64);
edit1.SetFocus;
exit;
end;
open; //以上用户输入都正常,打开数据库
end;
if adoquery1.RecordCount<>0 then
begin
application.MessageBox('登陆成功','提示信息',64);
Form2.show; //需要再建立一个form窗口用来作为登录正确后显示的窗体
self.Hide;
end
else
application.MessageBox('输入的用户名或密码错误','提示信息',64);
except
application.MessageBox('登陆失败','提示信息',64);
end; end;