在访问临时表/管理尺寸 [英] Temp Table in Access / Manage Size

查看:381
本文介绍了在访问临时表/管理尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些数据的访问文件。 为了执行某些计算,我需要创建一个从原始数据计算(产生)值某些表。 这些临时表的大小约为500 MB每个标准,我用它。 这有许多工作要做一遍又一遍至少50次不同的标准。

在所述第一部分已完成 - 临时表可以被丢弃。 问题是在Access甚至删除行和删除表文件的大小仍然很高之后。 由于在每次将结果传递的大小,尽管仍删除表增加。 不久,2GB墙上撞。

解决方案尝试:  1.使用VBA - 创建一个临时mdb文件 - >创建表有 - >链接到原始访问文件 - 保存在这里产生的价值观 - >使用进行计算 - >删除文件 做一遍。

这是非常缓慢插入记录到这个表。我beleive怎么一回事,因为它是一个链接表。插入我会做的数字是几十万。

  1. 结构紧凑,使用VBA修复当前DB - 没有明确的答案。发送按键的工作 - 但不能证明

  2. 使用一个单独的ACCDB文件'control_file_,这将做原始访问文件的工作,删除表,结构紧凑,维修,然后做一次又一次的下一个标准。请指教VBA code这一点。 在VBA code,它的连续性仍然存在。

解决方案

我可以推荐解决压缩数据库的问题是简单地用code我发表前一阵子为的重新启动和压实的MSACCESS数据库编程的。

另外,使用单独的临时数据库可能是最好的。 虽然有关业绩的一件事:使用一个单独的链接的数据库是不是慢,如果你需要保持一个链接表总是打开的护理
。 是什么使操作速度慢是数据库引擎需要创建和删除数据库锁定文件过于频繁的事实。如果你保持一个链接表打开(打开记录到一个虚拟表,不要关闭它),然后锁定文件将保留,你就会得到应有的性能。

I have an Access file with some data. To perform certain calculations , I need to create certain tables with calculated (generated) values from the Original data. The size of these temp tables is around 500 MB each criteria , I use it. This has to be done over and over again at least 50 times for various criteria.

Once the first part is completed - the temp table can be discarded. Problem is in Access even after deleting rows and dropping tables the file size still remains high. As a result after each pass the size still increases despite dropping the table. Soon the 2GB wall is hit.

Solution Tried : 1. using VBA - create a temp mdb file -> create table there -> link to original access file - save the generate values here -> use for calculations -> delete the file Do it all over again.

It is very slow Inserting records into this table. I beleive beacuse it is a Linked Table. Number of Inserts I would be doing is in hundred thousands.

  1. Compact and Repair Current DB using VBA - No clear answer. Send Keys work - but Fail Proof.

  2. Use a seperate accdb file 'control_file_ , which will do the work on the original access file , drop table , compact and repair and then do over again for the next criteria. Please advise VBA code for this. That continuity in the VBA code remains.

解决方案

The easiest way I could recommend to solve the issue of compacting the database would be to simply use the code I published a while ago for Restarting and compacting an MSAccess database programmatically.

Otherwise, using a separate temp database is probably the best. One thing regarding performance though: using a separate linked database is not slower if you take care of keeping a linked table always open.
What makes operations slow is the fact that the database engine needs to create and delete the database lock file too often. If you keep a linked table open (open a recordset to a dummy table and do not close it), then the lock file will remain and you'll get proper performance.

这篇关于在访问临时表/管理尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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