组合框直接连接到ODBC源 [英] Combo box connected to an ODBC source directly

查看:78
本文介绍了组合框直接连接到ODBC源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试这样做,以便我可以拥有一个组合框,根据我在文本框中输入的服务器名称和数据库名称列出SQL数据库中可用的表。我不想创建一个passthrough querydef。我在网上读到,我可以将DAO Recordset设置为组合框的行源。问题是我不知道如何为DAO Recordset提供连接字符串。


我使用passthrough querydef让它工作。我只是试图消除需要passthrough querydef。

I''m trying to make it so that I can have a combo box that lists the tables available in a SQL database based on the server name and database name that I have entered into textboxes. I don''t want to create a passthrough querydef. I read online that I might be able to set a DAO Recordset as the row source of the combobox. The problem is that I don''t know how to provide a connection string to a DAO Recordset.

I have gotten this to work using a passthrough querydef. I''m just trying to do away with needing the passthrough querydef.

推荐答案

Seth,


前面,我我不知道这是否有用,因为我不使用ODBC - 我的所有表都链接了Access DB。但是,您是否尝试过访问MSysObjects中的表名?你必须打开查看系统对象,但它可能会提供你连接的表名,然后从那里开始...


只是一个想法,因为我用它作为一个我的交换机列出表单和报告名称的源。
Seth,

Up front, I don''t know if this will work, as I don''t use ODBC--all my tables are linked Access DBs. But, have you tried accessing the Table names in MSysObjects? You will have to turn on viewing system objects, but it might provide your connected Table names, and then go from there...

Just a thought, as I have used this as a source for my Switchboard listing Form and Report names.


对于MSysObjects中的表,它必须是已导入的表。我正在寻找源数据库中的所有表,以便我可以从下拉框中添加它们。
For the tables to be in MSysObjects, it has to be a table that has already been imported. I''m looking for all tables in the source database so that I can add them from a drop-down box.


啊!现在我懂了。我想,有一种方法可以打开连接。对不起,我不能对这个问题给予更多帮助.....
Ahhh! Now I get it. There''s gotta be a way to open the connection ans see, I would think. Sorry I can''t be of more assistance on this one.....


这篇关于组合框直接连接到ODBC源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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