我看了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
解决方案 »
- Delphi数据库中怎样将数据保存成类似“Excel中一个单元格里存放1、2、3、……这样多条内容的功能”?
- 创建窗体时提示'The window does not have scroll bars 错误怎么解决?
- 福州某大学生,大学业余时间的作品-delphi写的电子书工具:藏经阁,欢迎各位使用。
- select distinct field_1 from table_1 ,开发环境下正常,转到例外一台机器上运行查询出table_1中的所有记录,奇怪!!
- 如何将rtf文件导入数据库?
- 高手请进,怎样让动态创建的组件如edit响应事件处理?不够加分,急
- NOTICE:DBCtrlGrid bug,bug,bug???
- 离职了~ 散粉,求祝福
- 请问有穷举QQ的程序吗?
- 山西政协:电信资费调整后百姓负担更重(欢迎讨论)
- 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 就行了