Moidif.SQL.Clear;
query1.SQL.Add('update card set openmoney=(:money)');
query1.Params[0].AsFloat:=55;
edit1.Text:=shopdata.Moidif.SQL.Text;
为什么我已经为参数money传值了但为什么在
edit1.text中显是还是update card set openmoney=(:money)

解决方案 »

  1.   

    事实就是这样的嘛。需要OPEN(),或才Active=TRUE时,参数才会被替换成真正原值参与计算。
      

  2.   

    楼主用的是插入语句;应该在程序后边加一句;
    query1.execsql;
      

  3.   

    query1.SQL.Clear;
    query1.SQL.Add('update card set openmoney=(:money)');
    query1.Params[0].AsFloat:=55;
    query1.execsql;edit1.Text:=shopdata.Moidif.SQL.Text;这样就行了;
      

  4.   

    shopdata.Moidif.SQL.Clear;
       shopdata.Moidif.SQL.Add('select * from card where cardid=(:cid)');
       shopdata.Moidif.Params[0].AsString:='000005';
      shopdata.Moidif.ExecSQL;
       shopdata.Moidif.Active:=true;
       edit1.Text:=shopdata.Moidif.SQL.Text;
    结果还是select * from card where cardid=(:cid)