添加到链接表时防止MDB膨胀 [英] Preventing MDB bloat when adding to linked table

查看:44
本文介绍了添加到链接表时防止MDB膨胀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。


此时我不会详细介绍,因为我有一个相当复杂(可能非常难看)的设置。相关细节是我有一个前端MDB,我正在使用ADO将记录添加到链接表中。


前端MDB不断吹嘘荒谬的大小,所以我必须继续压缩它。它压缩到几百KB,所以显然这是所有临时使用的内部内容。并且丢弃了。


我现在不是在寻找详细的帮助,只想了解一些需要注意的事项,或者尝试不同的想法,看看我是否可以缓解这种情况。我一直想知道批次是什么相关的ADO方法和参数都是关于。我是否应该进一步研究它们?


我考虑过的一件事(但还没有尝试过)直接在后端的桌子上工作。 MDB,而不是总是通过前端打开它。我本来希望避免这种事情,因为前端MDB是将所有东西拉到一起的一个漂亮,整洁的地方。后端表可能遍布整个地方。


至于我的代码,我只是在做AddNew,设置字段值,然后是更新。


通常我不会特别关注这个,因为在加载数据后我不介意压缩。但我有4到5年的数据需要加载,前端数据库在大约一个月的价值后接近2GB的限制。可以想象,这使得它成为一个相当劳动密集型的项目。我希望能够设置并忘记在星期五,发现它全部在星期一加载。

Hi all.

I won''t go into too much detail at this point, as I have a fairly complex (and probably quite ugly) setup. the relevant details are that I have a front-end MDB, and I''m using ADO to add records into a linked table.

The front-end MDB keeps blowing out to a ridiculous size, so I have to keep compacting it. It compacts back to a couple of hundred KB, so obviously this is all temporary stuff used "internally" and discarded.

I''m not looking for detailed help at this point, would just like to get some pointers on what sort of things to look out for, or different ideas to try, to see whether I can alleviate the situation. I have been wondering what the "batch" related ADO methods and parameters are all about. Should I be looking into them further?

One thing I''ve considered (but haven''t yet tried) is working directly with the table in the "back end" MDB, instead of always opening it through the front-end. I had hoped to avoid this sort of thing, as the front-end MDB is a nice, tidy place to pull everything together. The back-end tables may reside all over the place.

As for my code, I''m just doing an AddNew, setting field values, then an Update.

Normally I wouldn''t be especially concerned about this, as I don''t mind compacting after I load the data. But I have 4-5 years worth of data to load, and the front-end database approaches the 2GB limit after about one month-worth. As you can imagine, this makes it a rather labour-intensive project. I want to be able to "set and forget" on a Friday, and find it all loaded on Monday.

推荐答案

而不是AddNew尝试使用INSERT语句


DoCmd .RunSQL" INSERT INTO ..... etc"
Instead of AddNew try using an INSERT statement

DoCmd.RunSQL "INSERT INTO .....etc"



而不是AddNew尝试使用INSERT语句


DoCmd.RunSQLINSERT INTO ..... etc
Instead of AddNew try using an INSERT statement

DoCmd.RunSQL "INSERT INTO .....etc"



无意听起来粗鲁......为什么?



顺便说一句,它很有意思看到这个东西在运行 - 当然是我见过的第一个使用1.5GB内存的VB应用程序。 :)

我打算做一些关于内存使用的事情 - 这不是什么大问题 - 几乎只是懒惰的编程。

Without intending to sound rude... why?


Incidentally, it''s interesting to see this thing running - certainly the first VB application I''ve seen using around 1.5GB of RAM. :)
I do plan to do something about the memory usage - it''s not a big deal - pretty much just lazy programming.



没有打算听起来粗鲁......为什么?


顺便说一下,看到这个东西运行很有意思 - 当然第一个VB应用程序我见过使用大约1.5GB的RAM。 :)

我打算做一些关于内存使用的事情 - 这不是什么大问题 - 几乎只是懒惰的编程。
Without intending to sound rude... why?


Incidentally, it''s interesting to see this thing running - certainly the first VB application I''ve seen using around 1.5GB of RAM. :)
I do plan to do something about the memory usage - it''s not a big deal - pretty much just lazy programming.



INSERT INTO方法效率更高,因为你根本不需要打开记录集。

The INSERT INTO method is more efficient because you don''t need to open a recordset at all.


这篇关于添加到链接表时防止MDB膨胀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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