请问在DELPHI里怎么判断SQL2000里当前的一条记录是否可以修改或删除或已经不存在 谢谢

解决方案 »

  1.   

    如果要判断数据库中的数据是否存在,你用
    select 1 from 表 where ……
    如果返回值是1,就表示你要删除的数据存在,就可以执行删除操作了啊。
      

  2.   

    SELECT COUNT(子度) as count from TABLENAME WHERE ....
      

  3.   

    if exists(select 1 from table where ---)
    ----判断是否存在所给条件的记录,存在就执行下面的代码
    下面就可以写执行代码了
      

  4.   

    with ADOQuery1 do
    begin
      SQL.Clear;
      Close;
      SQL.Add('select * from 表 where 条件')
      Open;
    end;
    if ADOQuery1.RecordCount>0 then
    begin
      //存在
    end;
      

  5.   

    SQL.Add('select * from 表 where 条件')
    少了个分号,好像!
      

  6.   

    被別的用戶修改的話。加鎖的。for update nowait。
    如果想直到你是否有權限去修改用:select*from v$roles
    查看