请问如何判断数据库中的某个记录存在?某条记录的某个字段的值存在?
谢谢!

解决方案 »

  1.   

    locate()
    findkey()
    filter
    SQL语句
    方法很多啊
      

  2.   

    那就SELECT COUNT(*) AS Total from table1 where .......
    根据你的total的字段的值就知道有没有存在了
      

  3.   

    q.SQL.Add('StringOfSqlStatement');
    q.SQL.Open;
    if (not q.eof) then 记录存在!
    if q.FieldByName('StringOfFieldName').value=nil then 值不存在
      

  4.   

    with query do
    begin
    SELECT 字段 from table1 where .......
    if query.recordcount<>0 then
     .........
      

  5.   

    太多了。SQL语句select 
    findkey 
    locate!!!!