检查数据库中的链接表是否已更新/更改 [英] Check if a linked table in the database has been updated/changed

查看:100
本文介绍了检查数据库中的链接表是否已更新/更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VBA中是否有办法检查数据库中的链接表是否已更新



示例:

我有表格LedgerTemp这是一个文本文件的直接链接

局域网Ledger.txt

这个文本文件定期更新(覆盖)通过
一些大型机工作日夜


现在我只需手动运行一个宏,它只是从链接的LedgerTemp中基本上附加数据

。桌子到本地桌子Ledger


有没有办法我可以查看我的链接表是否已更改,如果是这样的话,我会检查
触发我的宏附加新数据?


谢谢

Cliff

Is there a way in VBA to check if a linked table in the database has
been updated?
Example:
I have a table "LedgerTemp" which is a direct link to a text file on
the LAN "Ledger.txt"
This text file is periodically updated (overwritten) through out the
day and night by some mainframe jobs.
Right now I just manually run a macro that just basically appends data
from the linked "LedgerTemp" table to a local table "Ledger"

Is there a way I can check to see if my linked table has changed and
if so trigger my macro that appends the new data?

Thanks
Cliff

推荐答案



< Cl ***** @ gmail.comschreef在bericht新闻:e6 ************************** ******** @ d21g2000 prf.googlegroups.com ...

<Cl*****@gmail.comschreef in bericht news:e6**********************************@d21g2000 prf.googlegroups.com...

VBA中是否有办法检查数据库中的链接表是否有

已更新?

示例:

我有一张桌子LedgerTemp这是一个文本文件的直接链接

局域网Ledger.txt

这个文本文件定期更新(覆盖)通过
一些大型机工作日夜


现在我只需手动运行一个宏,它只是从链接的LedgerTemp中基本上附加数据

。桌子到本地桌子Ledger


有没有办法我可以查看我的链接表是否已更改,如果是这样的话,我会检查
触发我的宏附加新数据?


谢谢

Cliff
Is there a way in VBA to check if a linked table in the database has
been updated?
Example:
I have a table "LedgerTemp" which is a direct link to a text file on
the LAN "Ledger.txt"
This text file is periodically updated (overwritten) through out the
day and night by some mainframe jobs.
Right now I just manually run a macro that just basically appends data
from the linked "LedgerTemp" table to a local table "Ledger"

Is there a way I can check to see if my linked table has changed and
if so trigger my macro that appends the new data?

Thanks
Cliff



如果''改变''意思是''添加新记录''...然后你可以试试像


VBA:

如果DCount(*, LedgerTemp")DCount(*,Ledger)然后RunYourMacro




或者在启动时调用你的宏并将其放入您的宏观条件

DCount(" *";" LedgerTemp")DCount(" *";" Ledger")


Arno R

If ''changed'' means ''new records added'' ... then you could try something like

VBA:
If DCount("*","LedgerTemp") DCount("*","Ledger") then RunYourMacro

Macro
Or call your macro at startup and put this in the condition of your macro
DCount("*";"LedgerTemp") DCount("*";"Ledger")

Arno R


< Cl ***** @ gmail.comwrote in message

news:e6 ******** ************************** @ d21g2000 prf.googlegroups.com ...
<Cl*****@gmail.comwrote in message
news:e6**********************************@d21g2000 prf.googlegroups.com...

在VBA中是否有办法检查数据中是否存在链接表基地已经更新了吗?

示例:

我有一张桌子LedgerTemp这是一个文本文件的直接链接

局域网Ledger.txt

这个文本文件定期更新(覆盖)通过
一些大型机工作日夜


现在我只需手动运行一个宏,它只是从链接的LedgerTemp中基本上附加数据

。桌子到本地桌子Ledger


有没有办法我可以查看我的链接表是否已更改,如果是这样的话,我会检查
触发我的宏附加新数据?


谢谢


Cliff
Is there a way in VBA to check if a linked table in the database has
been updated?
Example:
I have a table "LedgerTemp" which is a direct link to a text file on
the LAN "Ledger.txt"
This text file is periodically updated (overwritten) through out the
day and night by some mainframe jobs.
Right now I just manually run a macro that just basically appends data
from the linked "LedgerTemp" table to a local table "Ledger"

Is there a way I can check to see if my linked table has changed and
if so trigger my macro that appends the new data?

Thanks
Cliff



你可以使用FileDateTime函数检查文件的最后时间

更新。设置一个表格,如果需要,打开隐藏,并使用其计时器以您选择的间隔(例如300,000 - 这是5

)轮询

日期/时间以毫秒计的分钟数,并在Form_Timer事件中触发您的宏。

You can use the FileDateTime function to check when the file was last
updated. Set up a form, opened hidden if need be, and use its timer to poll
the date/time at an interval of your choice (say 300,000 - which is 5
minutes in milliseconds), and trigger your macro in the Form_Timer event.


" Stuart McCall" < sm ***** @ myunrealbox.comwrote in message

news:fi ******************* @ news.demon.co .uk ...
"Stuart McCall" <sm*****@myunrealbox.comwrote in message
news:fi*******************@news.demon.co.uk...

< Cl ***** @ gmail.comwrote in message

news:e6 **** ****************************** @ d21g2000 prf.googlegroups.com ...
<Cl*****@gmail.comwrote in message
news:e6**********************************@d21g2000 prf.googlegroups.com...

> VBA中是否有办法检查数据库中的链接表是否已更新?
示例:
我有一个表格LedgerTemp这是一个直接链接到局域网上的文本文件Ledger.txt
这个文本文件是由一些大型机作业日夜更新(覆盖)的。
现在我只需手动运行一个宏,它只是基本上从链接的LedgerTemp中附加数据
。表到本地表Ledger

有没有办法可以查看我的链接表是否已更改,如果是这样,会触发附加新数据的宏?

谢谢

Cliff
>Is there a way in VBA to check if a linked table in the database has
been updated?
Example:
I have a table "LedgerTemp" which is a direct link to a text file on
the LAN "Ledger.txt"
This text file is periodically updated (overwritten) through out the
day and night by some mainframe jobs.
Right now I just manually run a macro that just basically appends data
from the linked "LedgerTemp" table to a local table "Ledger"

Is there a way I can check to see if my linked table has changed and
if so trigger my macro that appends the new data?

Thanks
Cliff



您可以使用FileDateTime函数来检查文件的最后时间

更新。设置一个表格,如果需要,打开隐藏,并使用其计时器

以您选择的间隔轮询日期/时间(比如300,000 - 这是5

以毫秒为单位的分钟数,并在Form_Timer事件中触发您的宏。


You can use the FileDateTime function to check when the file was last
updated. Set up a form, opened hidden if need be, and use its timer to
poll the date/time at an interval of your choice (say 300,000 - which is 5
minutes in milliseconds), and trigger your macro in the Form_Timer event.



附录:我应该用以下内容完成:


如果日期/时间在Form_Timer事件中触发你的宏已经改变了。

Addendum: I should have finished that with:

and trigger your macro in the Form_Timer event if the date/time has changed.


这篇关于检查数据库中的链接表是否已更新/更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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