with adoqurey1 do adoquery1.close; adoquery1.sql.clear; adoquery1.sql.add('select * from table where bh= '+'''+edit1.text+'''); adoquery1.open; if adoquery1.RecordCount=0 then begin adoquery1.close; adoquery1.sql.clear; adoquery1.sql.add('insert into table ...); adoquery1.ExecSQL; end else adoquery1.close; adoquery1.sql.clear; adoquery1.sql.add(update table.... where bh= '+'''+edit1.text+'''.....); adoquery1.ExecSQL;省略的地方自己加~~