首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

用 adoqyery update 异常了

2012-04-04 
用 adoqyeryupdate 错误了Delphi(Pascal) codewith TADOQuery.Create(nil) dobegintryCloseSQL.ClearSQL

用 adoqyery update 错误了

Delphi(Pascal) code
  with TADOQuery.Create(nil) do  begin    try      Close;      SQL.Clear;      SQL.Add('update 新生表 set 公寓代码=:no1 where 姓名=:name1');      Parameters.ParamByName('no1').Value := StrToInt(cbb1.Text);     //说这里找不到参数no1      Parameters.ParamByName('name1').Value := qry1.FieldByName('姓名').AsString;      ExecSQL;    finally      Free;      qry1.Refresh;    end;  end;

求解

[解决办法]
你这是动态创建的ADOQuery,但没指定Connection
[解决办法]
直接使用控件呗,有必要非要动态创建么。

热点排行