当存储过程中返回值为nil时,如何避免出错?
with ADOCommand1 do
begin
Parameters.ParamByName('@用户名').Value:=combobox1.Text ;
Execute ;
try
label4.Caption:=Parameters.ParamByName('@密码').Value;
//此句,若返回@密码为空值时系统会出错,如何解决?
except
label4.Caption:='';
end;
end;
with ADOCommand1 do
begin
Parameters.ParamByName('@用户名').Value:=combobox1.Text ;
Execute ;
try
label4.Caption:=Parameters.ParamByName('@密码').Value;
//此句,若返回@密码为空值时系统会出错,如何解决?
except
label4.Caption:='';
end;
end;
解决方案 »
- 重载TObject类的构造函数应该怎么写?
- delphi 如何释放虚拟内存
- 读数据库不完整只有20个字符?是控件问题还是?
- delphi版无高手,,我的问题竟然解决不了..这段代码编译后在win2000环境下没任何问题,可是在XP中出错?怎么解决?...
- 怎样在菜单中添加类似Windows“开始”菜单左方从上到下的长条形,200分在线等.
- delphi中有没有字典类?
- 三层结构系统(delphi+oracle)DCOM源程序
- 请问一个关于内存流的问题,很急的说,内有段代码……
- 能谈谈你的心得吗?
- TCP/IP问题
- 求个C++ Builder6 Enterprise的注册码
- 请问,网络广播和网络电视如何实现啊?(直播得,不要录播的)
with ADOCommand1 do
begin
Parameters.ParamByName('@用户名').Value:=combobox1.Text ;
Execute ;
if Parameters.ParamByName('@密码').Value<>null then
label4.Caption:=Parameters.ParamByName('@密码').Value
else
label4.Caption:='';
end;
begin
Parameters.ParamByName('@用户名').Value:=combobox1.Text ;
Execute ;
label4.Caption:=VarToStr(Parameters.ParamByName('@密码').Value);
//此句,若返回@密码为空值时系统会出错,如何解决?
end;