with query1 do
begin
close;
sql.Clear;
sql.Add('update COURSE ');
sql.Add('set classroom ='''+edit1.Text +''',classtime ='''+edit2.Text+''',state=''3''');
sql.Add('where ID ='''+query1['ID']+'''');
execsql;
end;
上面是我的代码
大家应该大概明白我的意思了吧,可是系统老是出错???
谁可以告诉我为什么哦
begin
close;
sql.Clear;
sql.Add('update COURSE ');
sql.Add('set classroom ='''+edit1.Text +''',classtime ='''+edit2.Text+''',state=''3''');
sql.Add('where ID ='''+query1['ID']+'''');
execsql;
end;
上面是我的代码
大家应该大概明白我的意思了吧,可是系统老是出错???
谁可以告诉我为什么哦
begin
close;
sql.Clear;
sql.Add('update COURSE ');
sql.Add('set classroom ='''+edit1.Text +''',classtime ='''+edit2.Text+''',state=''3''');
sql.Add(' where ID ='''+query1['ID']+'''');
execsql;
end;试试。还有你Query有没有连到数据库
本来我就是设置query1.active:=true;
对了,楼上你改了哪个地方阿?我怎么感觉不出来哦,^_^
(@jsource char(4),
@jcurrent char(4)
) AS
begin
with query1 do
begin
close;
sql.Clear;
sql.Add('update COURSE ');
sql.Add('set classroom ='''''+edit1.Text +''''',classtime ='''''+edit2.Text+''''',state=3');
sql.Add('where ID ='''''+query1['ID']+'''''');
execsql;
end;
with query1 do
begin
close;
sql.Clear;
sql.Add('update COURSE ');
sql.Add('set classroom ='''''+edit1.Text +''''',classtime ='''''+edit2.Text+''''',state=3');
sql.Add('where ID ='''''+query1['ID']+'''''');
execsql;
end;或:
with query1 do
begin
close;
sql.Clear;
sql.Add('update COURSE ');
sql.Add('set classroom ="'+edit1.Text +'",classtime ="'+edit2.Text+'",state=3');
sql.Add('where ID ="'+query1['ID']+'"');
execsql;
end;试试!
我是照着书上敲的,就是那本程豫龙的delphi6数据库系统开发实例导航的102页
可是总是有问题,书上的风格都是一种哦,我可从来没见过你这种风格
with query1 do
begin
close;
sql.Clear;
sql.Add('update COURSE ');
sql.Add('set classroom ='''+edit1.Text +''',classtime ='''+edit2.Text+''',state=''3''');
sql.Add(' where ID ='''+ls_str+'''');
execsql;
end;
,query没有 fieldbyname 这个属性哦
把对的改对,有啥子意思
关键是把错的找出来嘛
我也以为是query['id ']错了,可是怎么改了