我看了CSDN以前的帖子,要不看不懂,要不就是出错,到底该怎么得到啊?
我做的一个普通的登陆功能:
procedure TForm_logo.Button1Click(Sender: TObject);
begin
with adoStoredProc1 do
begin
Close;
ProcedureName:='xueji_check;1';
Prepared:=true;
Parameters.Refresh; Parameters.ParamValues['@user_name']:= edit1.Text; if RaB_stu.Checked then
Parameters.ParamValues['@authority']:= 1
else if RaB_academy.Checked then
Parameters.ParamValues['@authority']:= 2
else
Parameters.ParamValues['@authority']:= 3; ExecProc;
edit1.Text := 存储过程的返回值;
end;
end;存储过程如下:
CREATE PROCEDURE xueji_check@user_name varchar(50),
@authority varchar(10)ASdeclare @abc int
select @abc=count(*) from xj_user
where username=@user_name and authority=@authority
return @abc
GO
我做的一个普通的登陆功能:
procedure TForm_logo.Button1Click(Sender: TObject);
begin
with adoStoredProc1 do
begin
Close;
ProcedureName:='xueji_check;1';
Prepared:=true;
Parameters.Refresh; Parameters.ParamValues['@user_name']:= edit1.Text; if RaB_stu.Checked then
Parameters.ParamValues['@authority']:= 1
else if RaB_academy.Checked then
Parameters.ParamValues['@authority']:= 2
else
Parameters.ParamValues['@authority']:= 3; ExecProc;
edit1.Text := 存储过程的返回值;
end;
end;存储过程如下:
CREATE PROCEDURE xueji_check@user_name varchar(50),
@authority varchar(10)ASdeclare @abc int
select @abc=count(*) from xj_user
where username=@user_name and authority=@authority
return @abc
GO
解决方案 »
- 多线程/进程tstringlist.add操作需要同步吗?
- TreeView1如何将选中记录动态显示在Edit上?
- 关于子窗体不能打开的问题
- 求教关于STRINGGIRD按回车键换行?
- 请教 windows 2000 下DCOM 连接服务器出现问题
- 如何判断注册表项目类型?
- ☆☆☆ Delphi 6 大 BUG ☆☆☆ 可导致 WebSnap 应用程序崩溃!
- 托盘图标问题
- 窗体最小化的时候怎么在任务栏的上面,(相当 于在开始菜单的上面),怎么让它只在任务栏里出现
- 怎样用delphi写一个用ini 数据库配置信息
- field'xxxx'not found!!
- 如何在SDI中的CFormView窗体中,实现分页窗体的功能
如:
edit1.Text := ADOStoredProc1.Parameters.ParamValues['@RETURN_VALUE'];
if .. then
Select 0 AS ReturnValue ,'登录成功!' as ReturnMsg
else
Select 1 as ReturnValue, '密码错误' as Return Msg直接用 AdoQuery Open 就行了