最后一步了,三个条件同时满足时显示.
为了赶时间把这个小程序做完``就差最后一步了`一个查询语句~求教
在TForm上放了三个Tedit和两个button.
三个Tedit分别对应OOO表里的三个字段A,B,C 当点第一个button查询时三个字段同时满足时显示到DBGrid的显示框里。
点第二个button时可以从表里删除显示的这条纪录。(库我以经联好了)
``大侠们帮帮忙,就差最后这一步了.....谢谢
为了赶时间把这个小程序做完``就差最后一步了`一个查询语句~求教
在TForm上放了三个Tedit和两个button.
三个Tedit分别对应OOO表里的三个字段A,B,C 当点第一个button查询时三个字段同时满足时显示到DBGrid的显示框里。
点第二个button时可以从表里删除显示的这条纪录。(库我以经联好了)
``大侠们帮帮忙,就差最后这一步了.....谢谢
with adoquery do
adoquery.Close;
adoquery.SQL.Clear;
adoquery.SQL.Add('delete from OOO ');
adoquery.SQL.Add('where A='+edit1.text'+ and b='+edit2.text+' and c=+'edit3.text+'' );
adoquery.open;
删除
with adoquery do
adoquery.Close;
adoquery.SQL.Clear;
adoquery.SQL.Add('delete from OOO ');
adoquery.SQL.Add('where A='+edit1.text'+ and b='+edit2.text+' and c=+'edit3.text+'' );
adoquery.ExecSQL;
//Button1写
//...
SQL字串 = Format('select * from %s where %s=''%s'' and %s=''%s'' and %s=''%s''',['OOO','A',Edit1.Text,'B',Edit2.Text,'C',Edit3.Text]);
//...//Button2写
DBGrid1.DataSource.DataSet.Delete;
//用2楼的带条件Delete的SQL也可以
with adoquery do
adoquery.Close;
adoquery.SQL.Clear;
adoquery.SQL.Add('select * from OOO ');
adoquery.SQL.Add('where A='+edit1.text'+ and b='+edit2.text+' and c=+'edit3.text+'' );
adoquery.open;
当然如果楼主使用的是其他连接方式,如BDE,那么adoquery, 可以换成BDE组页的query.