VB中的链接表 [英] Link Tables in VB

查看:83
本文介绍了VB中的链接表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨peeps,


我目前需要更改我最新的访问项目中的链接表,并希望使用VB来完成。通常我喜欢大多数人使用链接表管理器。


我正在设计的是一个在多个站点上使用的库存数据库,并希望每个站点都有一个BE(以减少一个大型数据库的WAN延迟),但是我会喜欢重新链接的选项(在极少数情况下),我找到了ADOX?以前链接代码,但似乎无法让它工作(所以我离开它)现在我认为它会更有用。


我基本上想在VB中镜像链接表管理器功能


任何帮助都会非常感激。

Dan

解决方案

以下是我用来链接外部表格和文件的两个函数:

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


HI,

感谢您的回复,首先我在您发布的代码的第25行收到错误3170。 />

其次是strFileName表的名称?它看起来应该对我来说?如果这是真的,是否需要表别名?


并且我不确定是否需要tmptable?你不能直接命名吗?如果表的名称相同(在不同的dbs中)会导致问题吗?

谢谢


@ Dan2kx


你需要给我错误文本,我没有时间查找它们。

@ Dan2kx


是的strFileName是表/文件的名称,表别名不是必需的,但是如果需要别名,我会把它留在那里,在我的情况下就是这样。

< a href =https://bytes.com/topic/access/answers/875900-link-tables-vb#post3520362\"rel =nofollowclass =at_reply> @ Dan2kx


您可以使用您想要的代码,我不会因为创建此代码而受到赞誉,而且我不知道会发生什么,因为如果它没有破裂,我就不会解决它。此外,我很确定您无法使用此代码覆盖具有相同名称的表格,因此您需要在重新链接之前删除表格。


-AJ

Hi peeps,

i have a current need to change the linked tables in my latest access project, and want to do it using VB. normally i like most people use the linked tables manager.

What i am designing is a stock database to be used on multiple sites, and want to have a BE for each site (to reduce WAN lag with one massive DB), however i would like the option to re-link (in rare circumstances), i have found ADOX? linking code previously but couldnt seem to get it to work (so i left it alone) now i think it would be more useful.

I basically want to mirror the link tables manager functio in VB

Any help would be much appreciated.

Dan

解决方案

Here are 2 functions I use to link to external tables and files:

Expand|Select|Wrap|Line Numbers


HI,
Thanks for the response, firstly i got a error 3170 at line #25 of your posted code.

secondly is the strFileName the name of the table? it looks like it should be to me? is there a need for the table alias if this is true?

and i am unsure of the need for a tmptable? can you not just name it straight off? does it cause a problem if the tables are named the same (in the different dbs)?

Thanks


@Dan2kx
You will need to give me the error text, I don''t have the time to look them up.

@Dan2kx
Yes strFileName is the name of the table/file, the table alias is not required but I leave it in there if the need for an alias arises, which in my case has.

@Dan2kx
You can do with the code what you wish, I won''t take credit for creating this code, and I don''t know what would happen because if it ain''t broke, I won''t fix it. Also, I am pretty sure you cannot overwrite tables with the same name using this code, so you will need to drop the table before you "relink".

-AJ


这篇关于VB中的链接表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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