MS Access数据库增长问题 [英] MS Access database grow issue

查看:77
本文介绍了MS Access数据库增长问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




为了修改Access表中的一些数据,我创建了以下代码:

展开 < span class =codeDivider> | 选择 | Wrap | Line数字

解决方案

第18行 - 虽然你可以这样做;但是,无论 DIM 语句在哪里,VBA编译器都会在运行时分配内存;因此,我们大多数人都会在代码的开头声明所有变量,这样就更容易维持。

你可以向自己证明这一点

- 进入代码

- 在你到达第18行之前

>菜单>查看>当地人

你会看到变量已经在列表中。当然,你必须在使用该变量的任何语句之前在代码中声明变量,傻我知道已经分配了内存,但这就是它的工作方式:)

第52行 - 悬挂结束如果 ?


28行至34行 - 临时表?如果您在数据库中反复创建和删除它们,临时表将使代码膨胀,尤其如此!实例化一个辅助数据文件,用于保存临时表并在完成后将其删除。


第44行 - 一遍又一遍地关闭和重新打开记录集可能会导致膨胀等问题。


+如果你是使用Access2007或更新版本,您真的应该考虑将文件格式升级到ACCDB版本。唯一的原因是,如果您使用折旧的用户安全模型 - 请注意,这是折旧的。 MS已经删除了对ACC97格式的支持,我怀疑将在以后的版本中删除对所有MDB格式的支持。


+++ 规范化(这里有更多细节)!

我怀疑你有:

展开 | 选择 | Wrap | 行号





你的回复。我首先将数据库构建为.accdb,但遇到了同样的问题。我试图包含一段代码来编译和修复数据库,但确实遇到了错误。正如我使用之前的mdb数据库所做的那样,我尝试了这种格式,但遇到了同样的问题。


第52行 - 挂起结束如果是我检查数据库大小的一部分,以防止损坏的数据库,如果它超过2G


实际上是Veld4的格式。必须是这样的。它是一种方式节点的一部分,我在另一个应用程序中使用它。拆分此字段将导致节点表超过5000万条记录,这将导致应用程序没有或至少工作太慢。


我将仔细查看规范化部分。


行:

展开 | 选择 | Wrap | 行号< /跨度>

Hi,

I have created below piece of code in order to amend some data in an Access table:

Expand|Select|Wrap|Line Numbers

解决方案

Line 18 - although you can do this; however, the VBA compiler allocates the memory at runtime no matter where the DIM statement is; thus, most of us will declare all of the variables at the beginning of the code, it''s just easier to maintain that way.
You can prove this to yourself
- step into the code
- before you get to line 18
>Menu>View>Locals
You''ll see that the variable is already in the list. Of Course, you do have to declare the variable in the code BEFORE any statements that use that variable, silly I know given that the memory is already allocated, yet that''s the way it works :)

Line 52 - hanging "end if" ?

Lines 28 thru 34 - temp table? Temp tables will bloat your code beyond belief especially if you create and delete them over and over again within the database! Instance a secondary data file to hold your temp table and delete it when done.

Line 44 - closing and reopening the recordset over and over and over again might result in issues such as bloating.

+ If you are using Access2007 or newer, you really should consider upgrading the file format to the ACCDB version. The only reason not to is if you are using the depreciated user-security model - be advised, that is depreciated. MS has already removed support for the ACC97 format and I suspect will remove support for all of the MDB formats in future releases.

+++ Normalization (more details here)!
I suspect you have:

Expand|Select|Wrap|Line Numbers


Hi,

Thx for your reply. I did build the database as an .accdb first, but had the same issue. I tried to include a piece of code to compile and repair the database, but did get errors. As I did this with a previous mdb database I tried this format, but had the same issues.

The Line 52 - hanging "end if" is a part in which I checked the database size in order to prevent a corrupted DB if it exceeded 2G

Actually the format of "Veld4" has to be this way. It is part of a way node, which I use in another application. Splitting this field would result in a node table of more than 50 million records, which would cause the application not or at least working too slow.

I will have a closer look at the normalization part.


The line:

Expand|Select|Wrap|Line Numbers


这篇关于MS Access数据库增长问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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