遍历一遍数据集 table.First; while not table.eof do begin //判断是否相同 table.Next; end;
在beforepost事件中使用sql语句 with table do begin close; sql.text := 'select * from 表 where 编号='+''''+edit.text+''''; open; end;//查找 //判断 if table.recordcount>1 then //放弃插入操作
sql 语句 select * from tabel where 编号=llll 如果他不为空,那么就重复了,禁止存
table.First;
while not table.eof do
begin
//判断是否相同
table.Next;
end;
with table do
begin
close;
sql.text := 'select * from 表 where 编号='+''''+edit.text+'''';
open;
end;//查找
//判断
if table.recordcount>1 then
//放弃插入操作
select * from tabel where 编号=llll
如果他不为空,那么就重复了,禁止存