L
loutian
Unregistered / Unconfirmed
GUEST, unregistred user!
with dm2.query1 do
begin
close;
sql.clear;
sql.add('select * from 用户表1');
sql.add('where 用户名=:usename');
sql.add('and 密码=assword');
parambyname('usename').Asstring:=edit1.text;
parambyname('password').AsString:=edit2.Text;
prepare;
open;
user_type:=fieldbyname('用户类型').Value;
name:=fieldbyname('用户名').Value;
end;
if dm2.query1.recordcount>0 then
begin
with dm2.StoredProc1 do
begin
params[0].AsString:=name;
params[1].AsString:=user_type;
params[2].AsString:='用户登陆';
prepare;
execproc;
end;
edit3.Text:=name;
edit4.Text:=user_type;
showmessage('登录成功!');
end
else showmessage('登录失败,请重新登录!');
begin
close;
sql.clear;
sql.add('select * from 用户表1');
sql.add('where 用户名=:usename');
sql.add('and 密码=assword');
parambyname('usename').Asstring:=edit1.text;
parambyname('password').AsString:=edit2.Text;
prepare;
open;
user_type:=fieldbyname('用户类型').Value;
name:=fieldbyname('用户名').Value;
end;
if dm2.query1.recordcount>0 then
begin
with dm2.StoredProc1 do
begin
params[0].AsString:=name;
params[1].AsString:=user_type;
params[2].AsString:='用户登陆';
prepare;
execproc;
end;
edit3.Text:=name;
edit4.Text:=user_type;
showmessage('登录成功!');
end
else showmessage('登录失败,请重新登录!');