with clientdataset do
begin
append;
FieldByName('names').AsString:=names;
..... Fieldbyname('id').AsInteger:=id;
post; if changecount>0 then
begin
objMaint.Uplate(delta,nErr);//Uplate定义在业务类TMaint中,objMaint为类TMaint的一个实例
if nErr>0 then
application.MessageBox('添加失败!',M_TITLE,MB_ICONWARNING)
else
application.MessageBox('添加成功!',M_TITLE,MB_ICONINFORMATION);
end;
end;procedure TMaint.Uplate(data :olevariant;out ErrCount:integer);
begin
with DM do
begin
DataSetProvider.ApplyUpdates(data,0,ErrCount);
end;
end;
代码如上,请高手指点!
begin
append;
FieldByName('names').AsString:=names;
..... Fieldbyname('id').AsInteger:=id;
post; if changecount>0 then
begin
objMaint.Uplate(delta,nErr);//Uplate定义在业务类TMaint中,objMaint为类TMaint的一个实例
if nErr>0 then
application.MessageBox('添加失败!',M_TITLE,MB_ICONWARNING)
else
application.MessageBox('添加成功!',M_TITLE,MB_ICONINFORMATION);
end;
end;procedure TMaint.Uplate(data :olevariant;out ErrCount:integer);
begin
with DM do
begin
DataSetProvider.ApplyUpdates(data,0,ErrCount);
end;
end;
代码如上,请高手指点!
解决方案 »
- 一个简单的线程问题,求助。
- 谁可以帮我看看这段代码
- form1.mainmenu1中包括:学生资料(n1)、毕业生资料(n2),两个菜单。怎么屏蔽掉两个菜单,使他们不可用
- 几个关于处理字符串的问题
- 做软件需要哪些理论知识?
- 关于clientsocket和serversocket的传送数据问题
- “大教室、实验室”安排、分配管理系统
- 请问用串口读取手机短信信息
- Cannot use empty object or column names.use a single space if necessary.
- 一点小问题,共同聊聊
- 有大量源码的地方,值得学习。帮忙点击一下
- 我用Delphi编写了一个指针数组的程序,编译无错,但运行时屏幕怎么一闪而过
改為:
clientdataset.ApplyUpdate(0);
您的意思是直接用clientdataset.ApplyUpdate,不用DataSetProvider.ApplyUpdates?
我改为下面这样,却提示数据集丢失,为何?
with clientdataset do
begin
append;
FieldByName('names').AsString:=names;
..... Fieldbyname('id').AsInteger:=id;
post; if changecount>0 then
begin
nErr:=ApplyUpdate(0);//********************改为这样
if nErr>0 then
application.MessageBox('添加失败!',M_TITLE,MB_ICONWARNING)
else
application.MessageBox('添加成功!',M_TITLE,MB_ICONINFORMATION);
end;
end;
Query.RequestLive=true了。