窗体属性为fsMDIChild
ADO联接在DataModule窗体
Connerction访问权限为:share deny none 
          试过readwrite代码如下:procedure TForm3.Button1Click(Sender: TObject);
var
    CommandSQL: string;
begin
    CommandSQL := 'insert into ClientList(Name,User,Telphone,Address) values('''+
                                          edit1.text+''','''+
                                          edit2.text+''','''+
                                          edit3.text+''','''+
                                          memo1.Lines.text+''')';
    showmessage(CommandSQL);
    with dmDataBase.ADOCommand1 do
    begin
        CommandText:=CommandSQL;
        Active := True;
    end;end;执行出现Cannot assign to a read-only property
        不能赋值到只读过程?

解决方案 »

  1.   

    问题出在Active := True;行,Active注意是Form的属性,是个只读的。正确用法如下
    with ADOCommand1 do begin
      CommandText := 'UpdateInventory';
      CommandType := cmdStoredProc;
      Execute;
    end;
      

  2.   

    我最初用adocommand1.active怎么不可以呢?大虾能不能说说原理,谢谢!
      

  3.   

    插入和更改、删除都要用Execute,要是查询的华就可以用active=true了,你可以试下!
      

  4.   

    HeLiang7(阿亮) :运行程序说cmdStoredProc没有定议
      

  5.   

    不用定义类型说可以执行了
    CommandType := cmdStoredProc;