with ADOQuery1 do
begin
sSQL:='update products set Name = :Name where ID = :ID';
Parameters.ParamByName('Name').Value:=trim(Edit2.Text);
Parameters.ParamByName('ID').Value:=trim(DBEdit1.Field.AsString);
if Active then
close;
SQL.Clear;
SQL.Add(sSQL);
execSQL;
ModifyForm.close;
end;错误:‘Name’not found!
为什么会出现这种错误?哪里出错了?
begin
sSQL:='update products set Name = :Name where ID = :ID';
Parameters.ParamByName('Name').Value:=trim(Edit2.Text);
Parameters.ParamByName('ID').Value:=trim(DBEdit1.Field.AsString);
if Active then
close;
SQL.Clear;
SQL.Add(sSQL);
execSQL;
ModifyForm.close;
end;错误:‘Name’not found!
为什么会出现这种错误?哪里出错了?
解决方案 »
- Canvas.Brush.Bitmap := mybgpic 传的是指针还是?
- 简单问题 跪求帮忙!!
- 怎样得到ADSL宽带的用户名和密码?
- 有人知道生成帮助文件(后缀chm)的软件名称吗?
- TBitmap可否进行拉伸??(就是跟放进TImage后一样)
- 請教有關﹕ACCESS +ADO+ DELPHI5.0 打包問題﹖急﹗﹗﹗﹗
- 简单问题
- 在delphi中怎样调用给c++builder的dll传值,以及怎样调用它返回的值??
- 送分问题——listview使用了imagelist设置了图标,如何使得item被选中时相应的图标颜色不变呢?
- 关于F1BOOK的问题,请各位前辈进入
- 关于数据库导出的问题,AdoDataSetDest 是什么意思啊?
- 新手上路,请多关照:关于Pagecontrol的简单问题
最少熟悉其中一种.
begin
sSQL:='update products set Name = :Name where ID = :ID';
if Active then
close;
SQL.Clear;
SQL.Add(sSQL);
Parameters[0].value:=trim(Edit2.Text);
Parameters[1].value:=trim(DBEdit1.Field.AsString);
execSQL;
ModifyForm.close;
end;
begin
sSQL:='update products set Name = :Name where ID = :ID';
if Active then
close;
SQL.Clear;
SQL.Add(sSQL);
Parameters[0].value:=trim(Edit2.Text);
Parameters[1].value:=trim(DBEdit1.Field.AsString);
execSQL;
ModifyForm.close;
end;
---------------------------------------
不行!这次提示的不知道是什么错误,好像是内存的问题。
begin
sSQL:='update products set Name = :Na where ID = :ID';
Parameters.ParamByName('Na').Value:=trim(Edit2.Text);
Parameters.ParamByName('ID').Value:=trim(DBEdit1.Field.AsString);
if Active then
close;
SQL.Clear;
SQL.Add(sSQL);
execSQL;
ModifyForm.close;
end;//试试看;
with ADOQuery1 do
begin
sSQL:='update products set Name = :Name where ID = :ID';
if Active then
close;
SQL.Clear;
SQL.Add(sSQL);
Parameters.ParamByName('Name').Value:=trim(Edit2.Text);
Parameters.ParamByName('ID').Value:=trim(DBEdit1.Field.AsString);
execSQL;
ModifyForm.close;
end;
begin
Close;
SQL.Add('update products set Name = :Na where ID = :ID');
Parameters.ParamByName('Na').Value:=trim(Edit2.Text);
Parameters.ParamByName('ID').Value:=trim(DBEdit1.Field.AsString);
execSQL;
end;
试一下吧。
数据库里面的字段最好不要设name之类的名字。