DbgridEh 对应数据集ADOTable1,其中有个字段 部门编码,另外增加查找字段比如 部门名称

ADOTable2对应查找数据集,包含 部门编码和 部门名称字段。

ADOTable1 打开后,再运行

ADOTable2.Close;

ADOTable2.Open;

后记录不是在第一个,需要再

ADOTable2.First;

否则 ADOTable2.Eof 为 true

如果ADOTable1对应的是普通的DBGRID,则不需要 ADOTable2.First;

奇怪了。

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DBGridEhGrouping, ToolCtrlsEh, DBGridEhToolCtrls, DynVarsEh, DB,
ADODB, EhLibVCL, GridsEh, DBAxisGridsEh, DBGridEh, StdCtrls, Grids, DBGrids; type
TForm1 = class(TForm)
DBGridEh1: TDBGridEh;
ADOConnection1: TADOConnection;
ADOTable1: TADOTable;
ADOTable2: TADOTable;
DataSource1: TDataSource;
DataSource2: TDataSource;
ADOTable1name: TWideStringField;
ADOTable1bmid: TIntegerField;
ADOTable1bmname: TStringField;
Button1: TButton;
DBGrid1: TDBGrid;
DBGrid2: TDBGrid;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);
begin
ADOTable2.Close;
ADOTable2.Open;
if ADOTable2.Eof then
ShowMessage('Eof')
else
ShowMessage('Not Eof')
end; procedure TForm1.FormCreate(Sender: TObject);
begin
ADOTable1.Open;
end; end.
object Form1: TForm1
Left =
Top =
Caption = 'Form1'
ClientHeight =
ClientWidth =
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch =
TextHeight =
object DBGridEh1: TDBGridEh
Left =
Top =
Width =
Height =
DataSource = DataSource1
DynProps = <>
IndicatorOptions = [gioShowRowIndicatorEh]
TabOrder =
object RowDetailData: TRowDetailPanelControlEh
end
end
object Button1: TButton
Left =
Top =
Width =
Height =
Caption = 'Button1'
TabOrder =
OnClick = Button1Click
end
object DBGrid1: TDBGrid
Left =
Top =
Width =
Height =
DataSource = DataSource2
TabOrder =
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -
TitleFont.Name = 'Tahoma'
TitleFont.Style = []
end
object DBGrid2: TDBGrid
Left =
Top =
Width =
Height =
DataSource = DataSource1
TabOrder =
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -
TitleFont.Name = 'Tahoma'
TitleFont.Style = []
end
object ADOConnection1: TADOConnection
Connected = True
ConnectionString =
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\XE Projects\Ehli' +
'b\Debug\Win32\db1.mdb;Persist Security Info=False'
LoginPrompt = False
Mode = cmShareDenyNone
Provider = 'Microsoft.Jet.OLEDB.4.0'
Left =
Top =
end
object ADOTable1: TADOTable
Connection = ADOConnection1
CursorType = ctStatic
TableName = 'person'
Left =
Top =
object ADOTable1name: TWideStringField
FieldName = 'name'
Size =
end
object ADOTable1bmid: TIntegerField
FieldName = 'bmid'
end
object ADOTable1bmname: TStringField
FieldKind = fkLookup
FieldName = 'bmname'
LookupDataSet = ADOTable2
LookupKeyFields = 'bmid'
LookupResultField = 'bmname'
KeyFields = 'bmid'
Lookup = True
end
end
object ADOTable2: TADOTable
Connection = ADOConnection1
CursorType = ctStatic
TableName = 'bm'
Left =
Top =
end
object DataSource1: TDataSource
DataSet = ADOTable1
Left =
Top =
end
object DataSource2: TDataSource
DataSet = ADOTable2
Left =
Top =
end
end

EhLib 的 DbgridEh 影响 其他数据集的Open方法的更多相关文章

  1. Thinkphp中的volist标签(查询数据集(select方法)的结果输出)用法简介

    参考网址:http://camnpr.com/archives/1515.html 通常volist标签多用于查询数据集(select方法)的结果输出,通常模型的select方法返回的结果是一个二维数 ...

  2. javascript父级鼠标移入移出事件中的子集影响父级的处理方法

    一.我们先分析其产生的原因: 1.当鼠标从父级移入子集时触发了父级的两个事件:a.父级的mouseout事件(父级离开到子集):b.由于事件冒泡影响,又触发了父级的mouseover事件(父级移入父级 ...

  3. 吴裕雄 python 神经网络——TensorFlow 数据集基本使用方法

    import tempfile import tensorflow as tf input_data = [1, 2, 3, 5, 8] dataset = tf.data.Dataset.from_ ...

  4. 吴裕雄--天生自然 pythonTensorFlow图形数据处理:数据集基本使用方法

    import tempfile import tensorflow as tf # 1. 从数组创建数据集. input_data = [1, 2, 3, 5, 8] dataset = tf.dat ...

  5. pandas 模拟生成数据集的快速方法

    快速生成一个DataFrame的方法: #模拟生成数据集的方法 import pandas as pd import numpy as np boolean=[True,False] gender=[ ...

  6. Knockout与Require框架同时使用时的visible绑定的问题,造成的影响,以及解决的方法。

    Knockout 可以将 visible 绑定到DOM 元素上,使得该元素的hidden 或visible 状态取决于绑定的值. 查看以下knockout的描述,http://knockoutjs.c ...

  7. EhLib使用全攻略

    使用 TDBSumList 组件   还记得以前有朋友问过这样一个问题:在 DBGrid 下如何像 Excel 一样能够做统计计算,实话说,使用 DBGrid 来做的话着实不易,不过现在有了这个咚咚, ...

  8. ArcGIS 网络分析[1.2] 利用1.1的线shp创建网络数据集/并简单试验最佳路径

    上篇已经创建好了线数据(shp文件格式)链接:点我 这篇将基于此shp线数据创建网络数据集. 在此说明:shp数据的网络数据集仅支持单一线数据,也就是说基于shp文件的网络数据集,只能有一个shp线文 ...

  9. ehlib 安装

    EhLibProjGroup110.groupproj,依次编译所有的包,再安装所有的dcl设计时包. == EhLib 7.0.133 Full Source 使用安装器EhLibInstaller ...

随机推荐

  1. openwrt的编译系统是如何生成squashfs文件系统的

    答:请看include/image.mk中的以下定义: define Image/mkfs/squashfs $(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mk ...

  2. 终于在nowcoder爆发了的懒惰

    题目 这类题目我实在忍不了了 Emma,随便做个nowcode比赛题吧,我在oj上也没找到 题意 求\(\sum_{L=1}^{n}\sum_{R=i}^{n}a[k](L<=k<=R)\ ...

  3. SpringJDBC源码分析记录

    我们使用JdbcTemplate时,调用的query方法为: public <T> List<T> query(String sql, @Nullable Object[] a ...

  4. java面试项目经验:框架及应用

    Java项目经验 Java就是用来做项目的!Java的主要应用领域就是企业级的项目开发!要想从事企业级的项目开发,你必须掌握如下要点:1.掌握项目开发的基本步骤2.具备极强的面向对象的分析与设计技巧3 ...

  5. 基于贝叶斯优化的超参数tuning

    https://arimo.com/data-science/2016/bayesian-optimization-hyperparameter-tuning/ 贝叶斯优化:使用高斯过程作为代理函数, ...

  6. python 获取格式化时间

    #!/usr/bin/python # -*- coding: UTF- -*- import time localtime = time.asctime( time.localtime(time.t ...

  7. DB中字段为null,为空,为空字符串,为空格要怎么过滤取出有效值

      比如要求取出微信绑定的,没有解绑的 未绑定,指定字段为null 绑定的,指定字段为某个字符串 解绑的,有的客户用的是更新指定字段为1,有的客户更新指定字段为‘1’ 脏数据的存在,比如该字段为空字符 ...

  8. SSH Secure Shell Client--- the host may be dow

    the host may be down,or there may be a problem with the network connection. Sometimes such problems ...

  9. 雷林鹏分享:Ruby 命令行选项

    Ruby 命令行选项 Ruby 一般是从命令行运行,方式如下: $ ruby [ options ] [.] [ programfile ] [ arguments ... ] 解释器可以通过下列选项 ...

  10. python怎样压缩和解压缩ZIP文件

    https://zhidao.baidu.com/question/1498409764366387259.html