delphi ios grid BindSourceDB bug
2016-05-19 12:25
591 查看
BindSourceDB4.DataSet :=nil;
BindSourceDB4.DataSet :=FDMemTable1;
grid绑定后显示数据正常,第二次赋值BindSourceDB4.DataSet就报错了。RAD berlin 存在此问题。
error in ios
windows平台下正常,IOS下报错。
Data.Bind.DBScope.pas,edit file add to current project,compiler that's ok!
DataSource := nil;
change to
if DataSource<>nil then
DataSource.DisposeOf;
DataSource := nil;
用query的EnableControls、DisableControls两个方法实现数据断开连接,依然会报错,所以还是用BindSourceDB4.DataSet=nil来断开。
BindSourceDB4.DataSet :=FDMemTable1;
grid绑定后显示数据正常,第二次赋值BindSourceDB4.DataSet就报错了。RAD berlin 存在此问题。
error in ios
windows平台下正常,IOS下报错。
Data.Bind.DBScope.pas,edit file add to current project,compiler that's ok!
function TCustomBindSourceDB.CreateSubDataSource: TDataSource; begin Result := TSubDataSource.Create(Self); Result.Name := 'SubDataSource'; // Do not localize Result.SetSubComponent(True); end; procedure TCustomBindSourceDB.SetDataSet(const Value: TDataSet); var LDataSource: TDataSource; begin if Value <> DataSet then begin if Value <> nil then begin if (FDataSource = nil) or (not (csSubComponent in FDataSource.ComponentStyle)) then begin LDataSource := CreateSubDataSource; LDataSource.DataSet := Value; Self.DataSource := LDataSource; end; end else DataSource := nil; if FDataSource <> nil then begin FDataSource.DataSet := Value; SetLinks(FDataSource); end; end; end;
DataSource := nil;
change to
if DataSource<>nil then
DataSource.DisposeOf;
DataSource := nil;
用query的EnableControls、DisableControls两个方法实现数据断开连接,依然会报错,所以还是用BindSourceDB4.DataSet=nil来断开。
相关文章推荐
- delphi中Message消息的使用方法
- 减小Delphi XE5编译出来的程序体积
- 减小Delphi2010程序的尺寸(关闭RTTI反射机制)
- DELPHI 中 Window 消息大全使用详解
- Delphi中的消息处理
- Delphi中操作INI文件
- Delphi Berlin 窗体代码分离风格 回到Delphi7传统风格
- delphi中如何将string类型的字符串数据转化成byte[]字节数组类型的数据
- Delphi Berlin 10.1 for iOS 成生 info.plist 顺序改变了
- Delphi Integer 转成单字节
- delphi const的用法
- Delphi 快捷键
- delphi中Treeview的使用介绍
- [付费视频]Delphi视频Android开发使用静态库(A)和动态库(SO)
- Delphi 释放数组中的数据
- delphi 10.1 berlin datasnap提交clientdataset.delta报:invalid variant type conversion(类型转换错误)问题的解决
- delphi中将 4 个 Byte 合成 1 个 Integer 的五种方法
- Delphi中@,^,#,$分别表示什么?
- Delphi中@,^,#,$特殊符号意义
- [Delphi] Webbroker ISAPI 示例说明