由于我的表A中,有个字段为了防止重复插入记录,而设为了主索引.现在,要循环的插入一组数据,但是当运行到有重复时,就停了下来报错,不能继续!!!
请问,如何让它有个错误(也就是提示重复记录),怎么也能让程序执行下一个插入动作....相关代码
-----------------------------------------------------------------------//执行SQL命令
Procedure ExeSQL(str:String);
begin
    try
        with RoForm.Q do
        begin
            SQL.Clear;
            SQL.Add(str);
            ExecSQL;
        end;
    except
        Exit;
    end;
end;//插入的代码
            for i:=0 to ListBox1.Items.Count-1 do
            begin
              try 
              begin
                  ExeSQL('insert into T1(users,address)values('''+ListBox1.Items.Strings[i]+''','''+trim(Edit1.Text)+''')') ;
              end
              except
                  Continue;
              end;
            end;