我编写了一段delphi程序,但一直提示错误,请高手帮忙看一下
1、procedureTqxglfrm.SpeedButton1Click(Sender:TObject);varsqlstr:string;s:string;begin...
1、
procedure Tqxglfrm.SpeedButton1Click(Sender: TObject);varsqlstr:string;s:string;begin//判断用户有没有选择要修改密码的用户名if ComboBox1.ItemIndex <>-1 thenbeginadoquery1.close;adoquery1.sql.clear;sqlstr:='select 密码 from yonghuinfor where 用户名="'+ combobox1.Text+'"';adoquery1.sql.add(sqlstr);adoquery1.open;if edit1.Text<>adoquery1.fieldvalues['密码'] thenbegin messagebox(handle,'密码错误','提示',MB_OK OR MB_ICONWARNING); edit1.Clear;endelsebeginadoquery1.Close;adoquery1.SQL.Clear; s:='Update yonghuinfor SET 权限="'+ComboBox2.Text +'" where'; s:=s+' 用户名= "'+ComboBox1.Text+'"';Adoquery1.SQL.Add(s);ADOQuery1.ExecSQL;yonghufrm.adoquery1.Active:=false;MessageBox(handle,'修改权限成功','提示',MB_OK);yonghufrm.adoquery1.SQL.Clear;yonghufrm.Adoquery1.SQL.Add('select * from yonghuinfor');yonghufrm.adoquery1.Active:=true;
end.
2、
另外一个窗体出现这个错误procedure Tyonghufrm.Button1Click(Sender: TObject);begin qxglfrm.ShowModal;end;
1、
2、 展开
procedure Tqxglfrm.SpeedButton1Click(Sender: TObject);varsqlstr:string;s:string;begin//判断用户有没有选择要修改密码的用户名if ComboBox1.ItemIndex <>-1 thenbeginadoquery1.close;adoquery1.sql.clear;sqlstr:='select 密码 from yonghuinfor where 用户名="'+ combobox1.Text+'"';adoquery1.sql.add(sqlstr);adoquery1.open;if edit1.Text<>adoquery1.fieldvalues['密码'] thenbegin messagebox(handle,'密码错误','提示',MB_OK OR MB_ICONWARNING); edit1.Clear;endelsebeginadoquery1.Close;adoquery1.SQL.Clear; s:='Update yonghuinfor SET 权限="'+ComboBox2.Text +'" where'; s:=s+' 用户名= "'+ComboBox1.Text+'"';Adoquery1.SQL.Add(s);ADOQuery1.ExecSQL;yonghufrm.adoquery1.Active:=false;MessageBox(handle,'修改权限成功','提示',MB_OK);yonghufrm.adoquery1.SQL.Clear;yonghufrm.Adoquery1.SQL.Add('select * from yonghuinfor');yonghufrm.adoquery1.Active:=true;
end.
2、
另外一个窗体出现这个错误procedure Tyonghufrm.Button1Click(Sender: TObject);begin qxglfrm.ShowModal;end;
1、
2、 展开
展开全部
1.
procedure Tqxglfrm.SpeedButton1Click(Sender: TObject);
var
sqlstr: string;
s: string;
begin
//判断用户有没有丛穗选择要修改密码的用户名
if ComboBox1.ItemIndex <> -1 then
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
sqlstr := 'select 密码 from yonghuinfor where 用户名 = '''+ combobox1.Text+''' ';
ADOQuery1.SQL.aAdd(sqlstr);
ADOQuery1.Open;
if edit1.Text<>adoquery1.fieldvalues['密码'] then
begin
messagebox(handle,'密码错误','提示',MB_OK OR MB_ICONWARNING);
edit1.Clear;
Exit;
end
else
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s := 'Update yonghuinfor SET 权渗岁卜限 = '''+ComboBox2.Text +''' where ';
s := s + ' 用户名 = '''+ComboBox1.Text+''' ';
Adoquery1.SQL.Add(s);
ADOQuery1.ExecSQL;
yonghufrm.ADOQuery1.Active := false;
MessageBox(handle, '修改权限雀旦成功', '提示', MB_OK);
yonghufrm.adoquery1.SQL.Clear;
yonghufrm.Adoquery1.SQL.Add('select * from yonghuinfor');
yonghufrm.adoquery1.Active := true;
end;
end;
end;
2.
procedure Tyonghufrm.Button1Click(Sender: TObject);
begin
qxglfrm := Tqxglfrm.Create(Application);
qxglfrm.ShowModal;
end;
procedure Tqxglfrm.SpeedButton1Click(Sender: TObject);
var
sqlstr: string;
s: string;
begin
//判断用户有没有丛穗选择要修改密码的用户名
if ComboBox1.ItemIndex <> -1 then
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
sqlstr := 'select 密码 from yonghuinfor where 用户名 = '''+ combobox1.Text+''' ';
ADOQuery1.SQL.aAdd(sqlstr);
ADOQuery1.Open;
if edit1.Text<>adoquery1.fieldvalues['密码'] then
begin
messagebox(handle,'密码错误','提示',MB_OK OR MB_ICONWARNING);
edit1.Clear;
Exit;
end
else
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s := 'Update yonghuinfor SET 权渗岁卜限 = '''+ComboBox2.Text +''' where ';
s := s + ' 用户名 = '''+ComboBox1.Text+''' ';
Adoquery1.SQL.Add(s);
ADOQuery1.ExecSQL;
yonghufrm.ADOQuery1.Active := false;
MessageBox(handle, '修改权限雀旦成功', '提示', MB_OK);
yonghufrm.adoquery1.SQL.Clear;
yonghufrm.Adoquery1.SQL.Add('select * from yonghuinfor');
yonghufrm.adoquery1.Active := true;
end;
end;
end;
2.
procedure Tyonghufrm.Button1Click(Sender: TObject);
begin
qxglfrm := Tqxglfrm.Create(Application);
qxglfrm.ShowModal;
end;
追问
还是不能运行
追答
发到我邮箱, 我看下可以吗..
347242590@qq.com
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询