自己做个Panle上面方按钮
处理事件主要就是
ADOQuery1.edit;
ADOQuery1.insert;
ADOQuery1.post;
ADOQyery1.close;
ADOQuery1.sql.clear;
ADOQuery1.sql.add('select * from table where name=''''+edit1.text+''');
ADOQuery1.open;
建议楼主还是看看书吧,这样比较系统的认识ADO数据库引擎技术!

解决方案 »

  1.   

    ADOquery的参数可以设置Parameters属性来添加。想要实现上述功能用SQL语句很容易。
    如添加数据
    insert into tablename (FieldName) values( value);
      

  2.   

    snake_eye(★蛇眼★上帝派来灌水的人)说得很清楚了啊~
    ADOQuery1.edit;//按钮1
    ADOQuery1.insert;//按钮2
    ADOQuery1.post;//按钮3下面是查询
    ADOQyery1.close;
    ADOQuery1.sql.clear;
    ADOQuery1.sql.add('select * from table where name=''''+edit1.text+''');
    ADOQuery1.open;删除修改sql代码
      

  3.   

    ADOCONNECTION1 的设置
    CONNECTTIONSTRING可先用系统生成的
    connected:=true or adoconnection.open;adoquery1 的connection 设置为adoconnection1
      

  4.   

    前提:adoquery对象名:query_data,connection在main中为frm_main.adoconnection  
    s_depotid,s_goodsid:string;
    number:integer;//临时变量s_depotid:=edit1.text;
    s_goodsid:=edit2.text;
    number:=strtoint(edit3.text);
    1,添加数据:
      with query_data do 
      begin
        frm_main.adoconnection.BeginTrans;//启动事务
        try
          close;
          sql.clear;
          sql.Text:='insert into  STOCKRECORD(depotid,goodsid,num)'
                  +'values('''+s_depotid+''','''+s_goodsid+''','''+number+''')';
          execsql;
          close;
          frm_main.ADOConnection.CommitTrans;//提交事务
        except
           if frm_main.ADOConnection.InTransaction then
              frm_main.ADOConnection.RollbackTrans;//回滚事务
           exit;
         end;
        修改数据:
      sql.text:='update stockrecord set num='+record.Text+'where goodsid='''+edit2.text+'''';
    删除同理!