为什么执行不下去呢?
if trim(edit3.Text)<>'' then
   begin
   if adoquery1.Active then
   adoquery1.Parameters[0].Assting:=trim(edit3.Text);-----这里执行不下去了
   adoquery1.Active:=true;
   end;

解决方案 »

  1.   

    if trim(edit1.text)<>'' then  
      begin
        ADOQuery1.Close;
        ADOQuery1.SQL.Clear;
        ADOQuery1.SQL.Add('insert into xinxi(姓名) values (:this_name)');
        ADOQuery1.Parameters[0].Value:=edit1.text;
        ADOQuery1.execsql;
      end;
      

  2.   

    if trim(edit3.Text)<>'' then
       begin
       if adoquery1.Active then
         adoquery1.Parameters[0].Assting:=trim(edit3.Text);这里AsString写成了Assting
         adoquery1.Active:=true;这里是什么意思?
       end;
      

  3.   


        ADOQuery1.Close;
        ADOQuery1.SQL.Clear;
    adoquery1.Parameters[0].Assting:=trim(edit3.Text);-----这里执行不下去了
    你这一句输入有错:应该是adoquery1.Parameters[0].Asstring:=trim(edit3.Text);
    其中苛ASSTRING处少了一个R
      

  4.   

    tadoquery.Parameters[0]返回的类型是TParameter,和tquery.Params[0]返回的类型TParam不同,没有asstring属性,只能用value属性,
      

  5.   

    是编译无法通过还是执行的时候有错?一般来说Query最好先Close在使用,否则会有很多莫名其妙的问题。
      

  6.   

    if trim(edit3.Text)<>'' then
       begin
       //if adoquery1.Active then
       if not adoquery1.Active then
       //adoquery1.Parameters[0].Assting:=trim(edit3.Text);-----这里执行不下去了
       adoquery1.Parameters[0].Asstring:=trim(edit3.Text); 
       adoquery1.Active:=true;
       end;
      

  7.   

    改为:if trim(edit3.Text)<>'' then
       begin
       if not adoquery1.Active then
       adoquery1.Parameters[0].Asstring:=trim(edit3.Text); 
       end;
      

  8.   

    已经给分,是因为ADO的Parameters 返回值没有asSTRING属性,把ASSTRING改成VALUE就OK了!