DBLookupComboBox控件怎么用----在线等除了设置DataSource,DataField这两个属性之外还要设置那个属性?
解决方案 »
- 无模式窗体的问题,实在是费解,请高手指点。
- 用delphi写了一个OCX,可是在网页上显示时,常常不正常,高手请近来帮我看看,分析分析
- SQL SERVER 2000修改了端口号,用ADO如何连接啊。
- 谁有casio dt-900数据采集器DLL编程的相关资料
- 在IdTCPServer1Execute处理中如何弹出多个模式窗口?
- 哪里有制作中文安装软件的软件?
- 给我介绍几本关于DELPHI的教材啊!谢谢!
- 如何做目录树TREEVIEWS
- ☆★多多关注☆★up有分☆★求一个最优的查询语句(比较通用的需求)☆★
- 如何用图片替代无标题栏窗体的标题栏呢,而且可以实现标题栏所有的功能,就像金山词霸那种?
- 很有意思关于windows消息的问题
- 拖动无标题窗体时产生的问题
双击dataset,建立newfield,设置类型为lookup,指定以下几项
datafield:指定要参考的字段,主数据集和参考数据集都包含该字段
dataset:参考数据集
keyfield:指定参考数据集中的关键字段(注意这个字段最后保存到数据库)
listfield:指定要显示的字段。
2.设置dblookupcombobox
datasource:指定主数据源
datafield:指定要参考的字段,主数据集和参考数据集都包含该字段
listsource:参考数据源
keyfield:指定参考数据集中的关键字段(注意这个字段最后保存到数据库)
listfield:指定要显示的字段。
用第一种方式的时候其实就跟第二中方法一样,不过不多用一个datasource
一. A lookup field defined for a dataset.
To specify list box items using a lookup field, the dataset to which you link the control must already define a lookup field. . To specify the lookup field for the list box items,1 Set the DataSource property of the list box to the data source for the dataset containing the lookup field to use.
2 Choose the lookup field to use from the drop-down list for the DataField property.When you activate a table associated with a lookup control, the control recognizes that its data field is a lookup field, and displays the appropriate values from the lookup.二.A secondary data source, data field, and key.
If you have not defined a lookup field for a dataset, you can establish a similar relationship using a secondary data source, a field value to search on in the secondary data source, and a field value to return as a list item. To specify a secondary data source for list box items,3 Set the DataSource property of the list box to the data source for the control.
4 Choose a field into which to insert looked-up values from the drop-down list for the DataField property. The field you choose cannot be a lookup field.
5 Set the ListSource property of the list box to the data source for the dataset that contain the field whose values you want to look up.6 Choose a field to use as a lookup key from the drop-down list for the KeyField property. The drop-down list displays fields for the dataset associated with data source you specified in Step 3. The field you choose need not be part of an index, but if it is, lookup performance is even faster.
7 Choose a field whose values to return from the drop-down list for the ListField property. The drop-down list displays fields for the dataset associated with the data source you specified in Step 3.When you activate a table associated with a lookup control, the control recognizes that its list items are derived from a secondary source, and displays the appropriate values from that source.