当前位置:编程学习 > Delphi >>

delphi怎么修改access数据库里的内容?

begin
with ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Text := 'UPDATE 会员统计 SET 会员卡号=:hykh,消费金额=:xfje where 会员姓名=:hyxm';
Parameters.ParamByName('hyxm').Value := Trim(Edit1.text);
Parameters.ParamByName('hykh').Value := Trim(Edit2.text);
Parameters.ParamByName('xfje').Value := Trim(Edit3.text);
ExecSQL;
end;
end;
编译没有出错。但是就是修改不了数据库里的内容。
我想实现的目的是点dbgrid eidt1 edit2 edit3显示内容(这些都成功了)。然后点修改可以修改数据库的内容。 http://e.ys168.com/?ossiceezdd
这个是源代和数据库。麻烦各位帮我看看。。
我的QQ邮箱 252667928@qq.com谢谢各位
答案:

改成这样子看看:

with ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Text := 'UPDATE 会员统计 SET 会员卡号=:hykh,消费金额=:xfje where 会员姓名=:hyxm';

ExecSQL;
Parameters.ParamByName('hyxm').Value := Trim(Edit1.text);
Parameters.ParamByName('hykh').Value := Trim(Edit2.text);
Parameters.ParamByName('xfje').Value := Trim(Edit3.text);

Post;
end;

上一个:delphi编译出的程序支持什么系统
下一个:怎样在delphi的click中加自定义参数

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,