如何填充dbcombo与特定字段的所有记录visual basic 6 [英] How fill a dbcombo with all the records of a specific field visual basic 6

查看:206
本文介绍了如何填充dbcombo与特定字段的所有记录visual basic 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要填充完整的dbcombo所有的记录在visual basic中的一个特定的字段6.我加入了dbcombo与数据控制,我指定的属性称为datafield,但dbcombo只显示一个记录
可以帮我吗?

I need to fill the full dbcombo with all the records the a specific field in visual basic 6. I joined that dbcombo with a data control and I specified the property called datafield, but the dbcombo show only a record Can something help me please?

我希望组合框的内容在sql中显示从学生中选择*。

I want the contents of the combobox to show Select * from students" in sql.

我有控制数据的数据源指向students.mdb

I have the datasource of the controldata point to "students.mdb"

推荐答案

您需要了解以下四个属性:

You are confusing the different properties in the DBCombo box. There are four properties you need to be aware of:


  1. DataSource

  2. DataField

  3. RowSource

  4. ListField

  1. DataSource
  2. DataField
  3. RowSource
  4. ListField

您需要将RowSource设置为Data Control,并将ListField设置为所需的字段(在您的情况下为学生)。

To get the list you want, you need to set the RowSource to the Data Control, and the ListField to the field you want, in your case Students.

DataSource和DataField只需要你将要更新底层数据库,DataSource再次是数据控件,DataField是你要更新的字段 - 它不需要与ListField相同的字段。

DataSource and DataField you only need if you are going to be updating the underlying database. DataSource is again the Data Control, and DataField is which field you want to update--it doesn't need to be the same field as the ListField.

这篇关于如何填充dbcombo与特定字段的所有记录visual basic 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆