vb6数据库绑定到内部表 [英] vb6 database tied to internal table

查看:93
本文介绍了vb6数据库绑定到内部表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在VB6方面有相当多的经验,并用它来创建与我们产品通信的应用程序。

我还没有使用过数据库。 />
我有一个类似的应用程序 -



该应用程序显示8个组合框,每个盒子都有可用的全套键盘按键,例如在第一个下拉菜单上,你可以,(并做)选择键a。在下一个下拉框中,您现在可以选择b-z而不是a(因为它已被使用)。

对于键盘上的8个键,用户可以选择一个动作(即打开灯或发出声音)。



我是什么需要的是从选择集中删除'a'(或任何其他键)的方法。



我相信这对于数据库是完美的,所以我想创建和内部表或记录集,它们只是为了这个目的与组合框绑定,但我没有看到任何帮助。



有没有人有关于这样的事情的任何信息?



谢谢,

马丁

Hi,
I have quite a bit of experience in VB6 and use it to create applications for communicating with our products.
I have not used databases.
I have an application something like -

The application comes up to show 8 combo boxes each box has the full set of keyboard keys available to it, so for instance on the first drop down you can, (and do) select key a. On the next dropdown box you can now select b-z but not a (since it was used).
For 8 keys on the keyboard the user can select an action (i.e. turn on a light or make as sound).

What I need is the way to remove 'a' (or any other key) from the selectable set once it is selected.

I believe this is perfect for a database, so I wanted to create and internal table or recordset that would be tied to the comboboxes for just this purpose but I do not see any help on doing so.

Does anyone have any info on such a thing?

Thanks,
Martin

推荐答案

您要问的一般概念被称为级联组合框 - 这是后续组合框中可用的值基于先前的选择...



根据您的需要,您可以为第一个组合框添加一个简单的select语句,如下所示:



The general concept you are asking about is known as "cascading combo boxes" - this is where the values available in subsequent combo boxes are based on previous selections...

Depending on exactly what you are wanting, you could have a simple select statement for your first combo box like this:

select FIELD from TABLE order by FIELD





然后为你的下一个组合框,有类似的东西:





Then for your next combo box, have something like:

select FIELD from TABLE where FIELD <> SELECTED_VALUE_IN_COMBO1 order by FIELD





这是实现目标的一般方法。如果您遇到某个特定部分,请仔细检查并重新发布代码。



This is the general way to achieve what you are after. Have a crack at it and post again with your code if you are getting stuck on a specific part.


这篇关于vb6数据库绑定到内部表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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