Query100.SQL.Add('select callerid from channelflag where  status=1 and lineno=:lineno');
  Query100.ParamByName('lineno').AsString:=IntToStr(LocalChannel);
---------------------------------------------------------------------
那错了?应该怎么写?
先谢谢了

解决方案 »

  1.   

    没错!
    不过你可以写成:Query100.ParamByName('lineno').value:=LocalChannel;
    但你写的没有错啊,可能是你其他的地方错了,或者数据库的结构不对。
      

  2.   

    status char型
    lineno int型
    错误信息:Query100: parameter 'lineno' not found
      

  3.   

    Query100.SQL.Add('select callerid from channelflag where  status='1' and lineno=:lineno');
      

  4.   

    Query100.SQL.Add('select callerid from channelflag where (status = 1) and (lineno = :lineno)');
      

  5.   

    Query100.ParamByName('lineno').value:=LocalChannel这样就OK!
      

  6.   

    'select  callerid  from  channelflag  where    status=1  and  [lineno]=:lineno'
    [lineno]=:lineno
    [lineno]=:lineno
    [lineno]=:lineno
    妈的什么鸟事?