程序段:
procedure TForm9.SnButton1Click(Sender: TObject);
var temp,pwd,quanxian:String;
begin
temp:=SnEdit1.Text;
pwd:=Snedit2.Text;
quanxian:=str_t;
if in_up=1 then
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from user_manage where name=:t1');
adoquery1.Parameters.ParamByName('t1').Value:=trim(snedit1.Text);
adoquery1.Open;
if adoquery1.Eof then
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('insert into user_manage(UserName,Password,Permission) values(:user1,:pwd1,:auth1)');
adoquery1.Parameters.ParamByName('user1').Value:=trim(snedit1.Text);
adoquery1.Parameters.ParamByName('pwd1').Value:=trim(snedit2.Text);
adoquery1.Parameters.ParamByName('auth1').Value:=str_t;
adoquery1.ExecSQL;
Snedit1.Text:='';
Snedit2.Text:='';
SnRadiobutton1.Checked:=false;
SnRadiobutton2.Checked:=false;
Snedit1.SetFocus;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from user_manage');
adoquery1.Open;
end;
end;
end;数据表:user_manage
username 文本
password 文本
permisssion 文本
Note 文本 允许为空
Ime 文本 允许为空出错信息;Project GHMIS.exe raised exception class EOleException with message
'至少一个参数没有被指定值'
问题解决了,我再加分,请各位大侠帮忙谢谢啦!
procedure TForm9.SnButton1Click(Sender: TObject);
var temp,pwd,quanxian:String;
begin
temp:=SnEdit1.Text;
pwd:=Snedit2.Text;
quanxian:=str_t;
if in_up=1 then
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from user_manage where name=:t1');
adoquery1.Parameters.ParamByName('t1').Value:=trim(snedit1.Text);
adoquery1.Open;
if adoquery1.Eof then
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('insert into user_manage(UserName,Password,Permission) values(:user1,:pwd1,:auth1)');
adoquery1.Parameters.ParamByName('user1').Value:=trim(snedit1.Text);
adoquery1.Parameters.ParamByName('pwd1').Value:=trim(snedit2.Text);
adoquery1.Parameters.ParamByName('auth1').Value:=str_t;
adoquery1.ExecSQL;
Snedit1.Text:='';
Snedit2.Text:='';
SnRadiobutton1.Checked:=false;
SnRadiobutton2.Checked:=false;
Snedit1.SetFocus;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from user_manage');
adoquery1.Open;
end;
end;
end;数据表:user_manage
username 文本
password 文本
permisssion 文本
Note 文本 允许为空
Ime 文本 允许为空出错信息;Project GHMIS.exe raised exception class EOleException with message
'至少一个参数没有被指定值'
问题解决了,我再加分,请各位大侠帮忙谢谢啦!
解决方案 »
- 关于cxDBLookupComboBox使用计算字段的问题
- 滚动文字显示闪烁如何消除?
- 各位大虾,请帮小弟一个忙
- 求 DevExpress.ExpressQuantumGrid.Suite 6.45及以上版本
- delphi中如何调用DLL,谢谢回复
- Delphi7中的DBGrid 与 Grid++ Report 5.0 报表问题
- quickrep打印,一条记录可以多页显示
- 数据保留小数以及文件存盘的问题
- MDI父子窗体问题好困惑问了N次,同仁回答了但是没有效果,请看...
- 关于SQL语句的问题,很急!!!请帮忙
- 急,indy服务器启动以后cpu占用率达100%
- Delphi学习群DELPHI研究和 学习。 大家发放资料的地方QQ2796202
很容易出错误的 你换成三个不同的QUERY试试 应该OK
×××× adoquery1.Parameters.ParamByName('t1').Value:=trim(snedit1.Text);
我觉的这里出错了。T1没有定义。
var name,pwd,auth:string;
begin
name:=edit1.Text;
pwd:=edit2.Text;
auth:=edit3.Text;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('insert into users_tab(name,pwd,auth) values(:user1,:pwd1,:auth1)');
adoquery1.Parameters.ParamByName('user1').Value;
adoquery1.Parameters.ParamByName('pwd1').Value;
adoquery1.Parameters.ParamByName('auth1').Value;
adoquery1.ExecSQL;
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit1.SetFocus;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from users_tab');
adoquery1.open;
end;