简体   繁体   English

为什么每次关闭特定表单时MS Access数据库都会崩溃?

[英]Why does my MS Access database crash every time I close a particular form?

My company uses a shared MS Access database and on the front end there is one particular button that causes the entire database to crash every time it is clicked. 我公司使用共享的MS Access数据库,并且在前端有一个特定的按钮,该按钮每次单击都会导致整个数据库崩溃。 I've reviewed the code but can't quite figure out why it is crashing every time. 我已经审查了代码,但无法完全弄清每次崩溃的原因。 The button is meant to save and close the form after creating a new record, and this is part of the code for the command to close: 该按钮用于在创建新记录后保存并关闭表单,这是用于关闭命令的代码的一部分:

Private Sub Form_Close()
    Forms!frmmenuPurchasing.Requery
    Forms!frmmenuPurchasing.Refresh
End Sub



Private Sub Close_Click()
On Error GoTo Close_Click_Err

    DoCmd.Close , ""

Close_Click_Exit:
    Exit Sub

Close_Click_Err:
    MsgBox Error$
    Resume Close_Click_Exit

End Sub

Does anyone see anything in this code that could be causing my database to crash when the form is closed? 是否有人在此代码中看到任何可能在关闭表单时导致我的数据库崩溃的信息? Any help is appreciated. 任何帮助表示赞赏。 TIA! TIA!

I guess that when you say "shared" that you mean your Access application uses another Access application as Library/Dll.... well is a bad practice and it causes issues.. 我猜想当您说“共享”时,意味着您的Access应用程序使用另一个Access应用程序作为Library / Dll ....很好,是一种不良做法,并且会引起问题。
Start by decompiling everything and check for missing/broken references. 首先对所有内容进行反编译,然后检查丢失/损坏的引用。
Also a good crashing candidate is ActiveX that are manipulate a bit out of the ordinary ...and last but not least...you could have some design fault in your code...like opening Recordsets and not closing or bad implementation...(this is tricky) ActiveX也是一个不错的崩溃候选者,它的操作方式与众不同...最后但并非最不重要的一点是……您的代码可能会出现设计错误……例如打开Recordsets而不关闭或执行不正确。 (这很棘手)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM