commandtext:= select * from 表A where 表A.字段1=:@MyStr
TAdodataset.params('@MyStr').value := DBEDIT1.TEXT ;TAdodataset.Open ;

解决方案 »

  1.   

    系统提示:
    UNDECLARED IDENTIFIER:'PARAMS'
    为什么?
      

  2.   

    SQL.Add(' select * from 表A where 表A.字段1=+#39+DBEDIT1.TEXT+#39);
      

  3.   

    TO tikkypeng(千两狂死郎):
    可以解释一下么?
    多谢帮忙?
      

  4.   

    Tadodataset完全可以在command中写入:
    if adodataset1.active then
       adodataset1.close;adodataset1.commandtext:='select * from 表A where 表A.字段1='+#39+DBEDIT1.TEXT+#39
    //如果你的数据是ACCESS则#39改为'"'adodataset1.open;
      

  5.   

    系统提示:UNDECLARED IDENTIFIER:'PARAMS',
    是因为你没有在adodataset中进行参数设置.
      

  6.   

    to cxsandsand(楚雄小琳琳):
    可不可以再解释一下
    1〉#39 的用法
    2〉adodataset中如何设置
    分不够我可再加!
      

  7.   

    adodataset的用法和adoquery的一样啊,你可以动态的加入也可以在设计时就确定,只要在
    它的commandtext中设置即可
    动态配置:
    同楚雄小琳琳的一样啊#39代表的是'
    在adodataset中你在object inspector中你找到commandtext属性在出现的对话框中键入即可