本文介绍了A2k的bug?删除db.props会导致损坏的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

在另一个线程中我遇到了更改db.props的问题

我在测试时遇到的另一个问题:db corrupt

我在循环中通过代码删除了db.props我无法再次启动数据库... @#$%$


警告:不要只是尝试在现有代码上执行代码D b。确保有副本! (我确实......)


测试我在A2000中创建了一个新数据库,只是设置了一些属性(菜单StartUpOptions)

Props如:AppTitle, StartUpForm,StartUpShowDBWindow,StartUpShowStatusBar

AllowShortcutMenus,AllowFullMenus,AllowBuiltInToolbars,AllowToolbarChanges,AllowSpecialKeys


运行以下代码并关闭数据库时,你不能再次进入。

紧凑而且维修也不起作用。


(刚刚测试过:即使没有更改或创建任何道具,代码也会杀死db!)


Sub TestProps()

Dim i As Integer

On Error Resume Next''你不能删除内置道具

For i = 0 To CurrentDb.Properties.Count - 1

Debug.Print CurrentDb.Properties(i).Name''只是为了看看是什么happpens

CurrentDb.Properties.Delete CurrentDb.Properties(i).Name

Next i

End Sub


运行之后代码并再次打开数据库:

访问''抱怨''使用DAO方法从以前的版本转换数据库

CompactDatabase等

(荷兰语留言,翻译可能不是100%)


我知道我必须轻轻地对待Access''但有时候我真的#$#%$$ ^ $ ^%& *

有何评论?代码有什么问题吗?


TIA

Arno R

解决方案




Hi all
In another thread I had problems changing db.props
Another problem I encountered while testing this: db corrupt
When I deleted db.props through code in a loop I could not start the db again ... @#$%$

Warning: Don''t just try following code on any existing db. Make sure there is a copy! (I did ...)

To test I created a NEW db in A2000 and just set some properties (menu StartUpOptions)
Props like: AppTitle, StartUpForm, StartUpShowDBWindow, StartUpShowStatusBar
AllowShortcutMenus, AllowFullMenus, AllowBuiltInToolbars, AllowToolbarChanges, AllowSpecialKeys

When you run the following code and close the db, you can''t get in again.
Also compact and repair doesn''t work.

(Just tested: Also even without changing or creating any props the code kills the db!)

Sub TestProps()
Dim i As Integer
On Error Resume Next ''You can''t delete build-in props
For i = 0 To CurrentDb.Properties.Count - 1
Debug.Print CurrentDb.Properties(i).Name ''just to see what happpens
CurrentDb.Properties.Delete CurrentDb.Properties(i).Name
Next i
End Sub

After running this code and opening the db again:
Access ''complained'' that the db was converted from a previous version by using DAO method
CompactDatabase etc.
(Message in Dutch, translation maybe not 100% )

I know I have to treat Access ''gently'' but sometimes I really #$#%$$^$^%&*
Any comments? Anything wrong with the code?

TIA
Arno R

解决方案




这篇关于A2k的bug?删除db.props会导致损坏的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 21:42